Posts

Showing posts with the label Unit Testing

Model Based Testing using Spec Explorer

Image
Model Based Testing or simply MBT relies on Behavioral Model of an implementation names SUT or System Under Test. This is why a model needs to be more abstract than the SUT itself and this can be achieved by encapsulation or by overlooking the details. The behavioral pattern can be achieved by monitoring the SUT’s runtime behavior. Let us illustrate the Model Based Testing in Detail using the Spec Explorer for Visual Studio 2010. Model Program is the testing model based on the behavioral pattern of SUT. The model program consists of a Cord Script, where the configurations and machines defining the exploration are being defined. Then, we need a model program where the system behavior is being defined. In the following Cord Script, we can see that, we have two implementations Add and ReadAndReset and so we have declared two actions into config Main. ParameterCombination has been used to test the implementations with given parameter range or constraint. We have to create the ...

Database Testing With DBUnit

Image
DBUnit is an Open Source Database Testing Framework which was created by Manuel Laflamme. DBUnit is a Database Unit Testing Framework to Test Database Driven Classes, Procedures or Functions. NUnit, MVC .NET/Visual Studio testing platforms can be used to build a standard unit test suite. Developer should create a dataset, defined within an XML file, and then extends one of a number of parent classes to inherit pre-defined functionality in order to use the framework. An IDbConnection implementation to connect to the database, then DbUnit.NET can be used to test the data access code. Following Operations can be performed using DBUnit: UPDATE TRUNCATE INSERT REFRESH DELETE CLEAN_INSERT DELETE_ALL NONE Other Operations: Composite Operation Transaction Operation Identity Insert Operation DBUnit Support Databases: OracleDatabase MsSQL MySQL IbmDB2 IbmInformix H2 HypersonicSQL PostgreSQL SybaseSQL InterBase OpenBase8 SapDB/MaxDB Derby FrontBase HOW TO WRITE A DBUnit TEST CASE ? To create a ...