Integration Test in Development

As I continue with given project, I study about mapping of state machine, so that I am familiar with the sequence of state. As I am clear with the flow of state machine, I then perform few integration test by creating instances along with initialization of ViewModel class, Event class, mocking IDialogService and IRegionManager.

The first integration test start with New button, I ensure the button to do what I expecting it to do. On click, New button should load a view with blank form as I need to let user input new set of data, which then will be saved into the database. Next integration test is Edit button behaviour test, the button should be available as one existing sequence was selected. Edit button allow user to select existing set of data, thus, edit certain data and change should be saved. After testing Edit button, I move on to Delete button, which is tested to make sure existing data in database can be deleted according to logic function from repository class.

As I am performing tests, I learnt to use debugger upon refactoring codes. If there is error in codes during testing, I would breakpoint on line of code and run the debugger to find where is the problem located. Debugger save me a lot of time to identify where I could have done wrong. Beside debugger, sometimes I would also use logger to make sure I get the output I want during testing. I truly having hard time when I perform functionality test on my first button, but debugger and logger come in handy.

Other than integration test, I learnt about idea of semaphore where it is used to provide synchronization of tasks with signaling mechanism. Two operation used in semaphore is wait() and signal() operation. it allows more than one thread to access the crictical section, but does not allow multiple processes to enter. It allow flexible management of resources.

Leave a Reply