Automated Testing: Difference between revisions
From IFWiki
No edit summary |
No edit summary |
||
Line 20: | Line 20: | ||
This sort of automated testing could be used for test-driven development. | This sort of automated testing could be used for test-driven development. | ||
==Code | ==Sample Code== | ||
<pre> | <pre> | ||
Verify Player Description is a test. | Verify Player Description is a test. | ||
Line 30: | Line 30: | ||
1 "examine me" "^As good\-looking as ever\.\n\n$" | 1 "examine me" "^As good\-looking as ever\.\n\n$" | ||
2 "x myself" "^As good\-looking as ever\.\n\n$" | 2 "x myself" "^As good\-looking as ever\.\n\n$" | ||
</pre> | |||
==Sample Transcript== | |||
<pre> | |||
>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 | |||
</pre> | </pre> | ||
Line 36: | Line 51: | ||
* ''Automated Testing'' ([[Roger Carbol]]; 26-Oct-2010; [[Glulx]]). | * ''Automated Testing'' ([[Roger Carbol]]; 26-Oct-2010; [[Glulx]]). | ||
** Release 1 / Serial number 090116 | ** Release 1 / Serial number 090116 | ||
==Links== | ==Links== | ||
===Download=== | ===Download=== | ||
* [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 Download]from the [[Inform 7]] site. | ||
[[Category:Games]] [[Category:Games in 2010]] [[Category:Glulx games]] [[Category:Inform 7 games]] [[Category:Extensions]] | [[Category:Games]] [[Category:Games in 2010]] [[Category:Glulx games]] [[Category:Inform 7 games]] [[Category:Extensions]] |
Revision as of 20:45, 27 October 2010
Automated Testing | |
---|---|
![]() | |
Author(s) | Roger Carbol |
Publisher(s) | n/a |
Release date(s) | 26-Oct-2010 |
Authoring system | Inform 7 |
Platform(s) | Glulx |
Language(s) | English |
License(s) | Freeware |
Multimedia | |
Color effects | optional |
Graphics | none |
Sound/Music | none |
Ratings | |
Cruelty scale | Cruelty to be determined |
What It Does
Allows the author to create and run automated tests, which could be used for test-driven development.
Requirements and Restrictions
- for Glulx only
- uses Text Capture by Eric Eve.
- uses Glulx Text Effects by Emily Short.
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