How it works...

Test libraries are simply standard codeunits that contain sets of functions that can be used across all of your tests, in order to create consistent data and processes.

Microsoft provides hundreds of test libraries that provide standard ways to create virtually any type of data, from master records such as customers, vendors, and items to more complex structures such as documents and journals.

Test libraries give you the ability to set the standards for your automated tests. For example, let's assume that you have created a new document entity. What do you test? Well, any time you create a new document entity, it's pretty safe to say that you should have a standard set of tests that you need to create, no matter what the actual functionality of the entity is. I'm talking about things like this:

  • Create a document header with x lines.
  • Create a document line.
  • Delete the document header (in turn deletes lines).
  • Delete a document line.
  • Add a comment to the document header
  • Add a comment to the document line

By setting up a standard test library that defines the previous functions, it makes it really easy to ensure that any time you add a new document entity, you also create the same standard tests for it.

If you are really serious about automated testing (why wouldn't you be?), then take a look at Test-Driven Development (TDD). In this approach, you begin building a new feature by creating the tests and then building the feature to meet those test scenarios. Test libraries are a great way of promoting TDD, as the first thing you can do is create your test library and add stubs for all of the standard functions for the entities that your feature needs to interact with.

Check out more information on TDD here: http://www.agiledata.org/essays/tdd.html.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.129.23.30