Showing posts with label Testing. Show all posts
Showing posts with label Testing. Show all posts

Tuesday, January 04, 2011

WCAT Fiddler Extension

Discovered the WCAT Fiddler Extension today and already it's saved us shed loads of time by generating Scenario files from within Fiddler.

Simply install the extension from here, fire up Fiddler and start capturing your browser requests. Once you have captured the requests you require, select those sessions in Fiddler, right-click and click 'Run WCAT script for selected sessions'.

This will attempt to automatically run WCAT with the generated scenario file (however I could not get this bit to work?). The generated Scenario file is created in the %TEMP% directory with a *.wcat extension and can therefore be taken from there and used manually with the WCAT controller.

Monday, December 28, 2009

Pex - Automated White Box Testing



Pex generates Unit Tests from Parameterized Unit Tests through Automated White box Testing based on Input Generation:
  • Can generate inputs for hand-written Parameterized Unit Tests.
  • Can try to find bugs in an existing .Net assemblies by using the Pex Wizard to create simple parameterized unit tests automatically.
  • Uses a constraint solver to systematically generate relevant inputs for the program-under-test. The result is a minimal test suite with maximal code coverage.
  • Pex emits tests and mocks for MSTest.


See:

Thursday, December 17, 2009

Unit Testing: Properties of Good Tests

Some more gems to remember from the Pragmatic Unit Testing book. Properties of good tests should be A-TRIP:
  • Automatic - unit tests need to be invoked and the results checked automatically
  • Thorough - need to test everything that is likely to break
  • Repeatable - every test should be able to run over and over again, in any order, and produce the same results
  • Independent - tests should be tightly focused, and independent from the environment and each other
  • Professional - tests must be written and maintained to the same professional standards as production code

Sunday, December 13, 2009

Unit Testing: What to Test? Right-BICEP and CORRECT

I've finally gotten round to reading Pragmatic Unit Testing by Andrew Hunt and David Thomas (the Java with JUnit version - which confirms that it was purchased a while ago now I am focusing upon .NET development).

Two handy reminders when you are thinking about what to test in your unit tests are:

Right-BICEP
  • Right - Are the results right?
  • B - are all the boundary conditions correct?
  • I - can you check the inverse relationships?
  • C - can you cross-check results using other means?
  • E - can you force error conditions to happen?
  • P - are performance characteristics within bounds?

CORRECT

  • C - Conformance - does the value conform to an expected format?
  • O - Ordering - is the set of values ordered or unordered as appropriate?
  • R - Range - is the value within reasonable minimum and maximum values?
  • R - Reference - does the code reference anything external that isn't under direct control of the code itself?
  • E - Existence - does the value exist (e.g. is not null, non-zero, present in a set)?
  • C - Cardinality - are there exactly enough values?
  • T - Time (absolute and relative) - is everything happening in order? At the right time? In time?