Automated Testing: Difference between revisions

From IFWiki

Line 48: Line 48:


==Links==
==Links==
* [http://inform7.com/extensions/Roger%20Carbol/Automated%20Testing/index.html Download] from the [[Inform 7]] site.
* [http://inform7.com/extensions/Roger%20Carbol/Automated%20Testing/index.html Automated Testing] at the [[Inform 7]] site.
** [http://inform7.com/extensions/Roger%20Carbol/Automated%20Testing/Automated%20Testing.i7x Download this extension].
** [http://inform7.com/extensions/Roger%20Carbol/Automated%20Testing/doc_0.html View its documentation].
** [http://inform7.com/extensions/Roger%20Carbol/Automated%20Testing/source.html View its source code].
* {{ifdb game|Automated Testing|7ih90fl0hr5vrpfq}}
* {{ifdb game|Automated Testing|7ih90fl0hr5vrpfq}}


[[Category:Inform 7]] [[Category:Needs cleanup]]
[[Category:Inform 7]] [[Category:Needs cleanup]]

Revision as of 08:25, 28 October 2010

Automated Testing small cover.jpg

Automated Testing by Roger Carbol is an Inform 7 library extension. It allows the author to create and run automated tests, which could be used for test-driven development.

Requirements and Restrictions

Notable Features

Automated Testing allows the author to create and run automated tests.

The test scripts are stored as rows of tables that belong to test objects. These scripts specify a number of parser commands, such as "examine me", and the corresponding response expected from the game, such as "As good-looking as ever."

They are automated in that the author can quickly execute all defined test scripts and receive a report on which passed and which failed. The virtual machine is restarted between tests.

This sort of automated testing could be used for test-driven development.

Sample Code

    Verify Player Description is a test.
        The index of Verify Player Description is 1.
        The steps of Verify Player Description is the Table of Steps for Verify Player Description.

    Table of Steps for Verify Player Description
  	order  	command  	response  
  	1  	"examine me"  	"^As good\-looking as ever\.\n\n$"  
  	2  	"x myself"  	"^As good\-looking as ever\.\n\n$"   

Sample Transcript

>ASSERT ALL

[...]

∙ success: 1 Verify Player Description, step 1
∙ success: 1 Verify Player Description, step 2
∙ success: 2 Verify Cabin Description, step 1
∙ success: 3 Verify Rods-and-Case, step 1
# FAIL: 3 Verify Rods-and-Case, step 2
∙ success: 3 Verify Rods-and-Case, step 3
∙ success: 3 Verify Rods-and-Case, step 4

Versions

Release 1

  • Automated Testing (Roger Carbol; 26-Oct-2010; Glulx).
    • Release 1 / Serial number 090116

Links