Automated Testing: Difference between revisions

From IFWiki

No edit summary
(Added to Category:Testing)
 
(10 intermediate revisions by 2 users not shown)
Line 1: Line 1:
<table style="width:100%;margin-bottom:1em;clear:both"><tr><td>{{extension}}</td></tr></table>
[[Image:Automated Testing small cover.jpg|right]] '''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.


{{game infobox|title=Automated Testing|image=[[Image:Automated Testing small cover.jpg]]|author=[[Roger Carbol]]|publisher=n/a|released=26-Oct-2010|authsystem=[[Inform 7]]|platform=[[Glulx]]|language=English|license=Freeware|color=optional|graphics=none|sound=none|cruelty=TBD}}
==Requirements and Restrictions==
 
* For [[Glulx]] only.
==What It Does==
* Uses [[Text Capture]] by [[Eric Eve]].
Allows the author to create and run automated tests, which could be used for test-driven development.
* Uses [[Glulx Text Effects]] by [[Emily Short]].


==Notable Features==
==Notable Features==
Line 15: Line 15:
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==
==Sample Code==
<pre>
    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$" 
</pre>
 
==Sample Transcript==
<pre>
<pre>
: Verify Player Description is a test.
&gt;ASSERT ALL
:: 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
∙ success: 1 Verify Player Description, step 1
::  order  command  response 
∙ success: 1 Verify Player Description, step 2
::  1  "examine me"  "^As good\-looking as ever\.\n\n$" 
∙ success: 2 Verify Cabin Description, step 1
:: 2  "x myself"  "^As good\-looking as ever\.\n\n$" 
∙ 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>


==Versions==
==Versions==
===Release 1===
* version 1/090116 by [[Roger Carbol]].
* ''Automated Testing'' ([[Roger Carbol]]; 26-Oct-2010; [[Glulx]]).
** Release 1 / Serial number 090116
{{sectstub}}


==Links==
==Links==
===Download===
* [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/index.html Download]from 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].
{{game stub|Notable Features, full version info.}}
** [http://inform7.com/extensions/Roger%20Carbol/Automated%20Testing/source.html View its source code].
* {{ifdb game|Automated Testing|7ih90fl0hr5vrpfq}}


[[Category:Games]] [[Category:Games in 2010]] [[Category:Glulx games]] [[Category:Inform 7 games]] [[Category:Extensions]]
[[Category:Inform 7 extensions]]
[[Category:Testing]]

Latest revision as of 13:20, 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

Links