mirror of
https://github.com/EiffelSoftware/eiffel-org.git
synced 2025-12-07 23:32:42 +01:00
Update wikipage Create a manual test. (Signed-off-by:jocelyn).
git-svn-id: https://svn.eiffel.com/eiffel-org/trunk@1459 abb3cda0-5349-4a8f-a601-0c33ac3a8c38
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
[[Property:title|Create a manual test]]
|
||||
[[Property:weight|2]]
|
||||
[[Property:uuid|e78f25e3-ed3a-f8fa-e71d-28a4dda1825f]]
|
||||
[[Property:uuid|32273F6B-AA84-475F-86B8-143F212FB40E]]
|
||||
==A system to test==
|
||||
|
||||
For developing our manual test, let's use a simple system that contains a class modeling bank accounts. Here are two classes that will make up our system. The first, <code>APPLICATION</code> will be the root class of our system. <code>APPLICATION</code> really only serves to declare an attribute of type <code>BANK_ACCOUNT</code>, which is the class we will write a test against. <code>APPLICATION</code> looks like this:
|
||||
@@ -98,7 +98,7 @@ Depending upon your version and platform, the AutoTest interface should look abo
|
||||
To begin the process of creating a new test, click the Create New Test button ( [[Image:create new tests]] ) on the interface's tool bar. When you click this button, by default AutoTest will set you up to create a new Manual test. To choose a different test type, click the small triangle to the right of the Create New Test button and you'll be presented with a drop-down menu of choices:
|
||||
|
||||
|
||||
[[Image: AutoTest create new test|Create new test drop-down menu]]
|
||||
[[Image:AutoTest create new test|Create new test drop-down menu]]
|
||||
|
||||
|
||||
For now, let's select Create Manual Test.
|
||||
@@ -108,7 +108,7 @@ If this is the first time you've used the testing tool for this project, it is l
|
||||
|
||||
[[Image:AutoTest add testing libraries dialog]]
|
||||
|
||||
You want EiffelStudio to do this before launching the wizard so, click "Yes". In a moment your system will have recompiled with the testing library classes available. Remember that you won't need to interact much with the testing classes, but AutoTest uses them, so they need to be available. As long as the testing classes stay available, you should not see this dialog again for the current project.
|
||||
You want EiffelStudio to do this before launching the wizard so, click "Yes". In a moment, your system will have recompiled with the testing library classes available. Remember that you won't need to interact much with the testing classes, but AutoTest uses them, so they need to be available. As long as the testing classes stay available, you should not see this dialog again for the current project.
|
||||
|
||||
|
||||
==The Manual Test Pane==
|
||||
@@ -158,7 +158,7 @@ We'll choose class <code>BANK_ACCOUNT</code> and feature <code>deposit</code>, c
|
||||
Now you should see the coverage tag in the list of '''Tags used in new test'''.
|
||||
|
||||
|
||||
[[Image: AutoTest Tags pane|Tags pane]]
|
||||
[[Image:AutoTest Tags pane|Tags pane]]
|
||||
|
||||
|
||||
That takes care of adding our coverage tag, so let's click '''Next''' to go to the next wizard pane, the '''General''' pane.
|
||||
@@ -167,10 +167,10 @@ That takes care of adding our coverage tag, so let's click '''Next''' to go to t
|
||||
==The General Pane==
|
||||
|
||||
|
||||
[[Image: AutoTest General pane empty|The General Pane]]
|
||||
[[Image:AutoTest General pane empty|The General Pane]]
|
||||
|
||||
|
||||
We will use this wizard pane to name our test class and let AutoTest know where we want the test class to reside. You can give a test class any name you wish, as long as it doesn't conflict with another class name in your system. If you try to type in a class name that already exists, the wizard will let you know right away by changing the text color to red. There is a convention that has arisen around test class names. If possible make the test class name the name of the target class, prefixed with <code>TEST_</code>. So in our case, we want to build a test against a feature of the <code>BANK_ACCOUNT</code> class, so we will name our test class <code>TEST_BANK_ACCOUNT</code>.
|
||||
We will use this wizard pane to name our test class and let AutoTest know where we want the test class to reside. You can give a test class any name you wish, as long as it doesn't conflict with another class name in your system. If you try to type in a class name that already exists, the wizard will let you know right away by changing the text color to red. There is a convention that has arisen around test class names. If possible, make the test class name the name of the target class, prefixed with <code>TEST_</code>. So in our case, we want to build a test against a feature of the <code>BANK_ACCOUNT</code> class, so we will name our test class <code>TEST_BANK_ACCOUNT</code>.
|
||||
|
||||
Now, for the question of where the tests should be kept.
|
||||
|
||||
@@ -270,7 +270,7 @@ covers/{BANK_ACCOUNT}.withdraw
|
||||
</code>
|
||||
So when ever you ask to view or run all the tests that <code>covers</code> either <code>deposit</code> or <code>withdraw</code>, this test would show up in that set.
|
||||
|
||||
The "covers" tags, as you saw earlier, can be generated by AutoTest's New Eiffel Test Wizard when you create a new test. But you could enter the tag manually, as well. For example if you had written a high level test that exercised all or most of the functionality of the class <code>BANK_ACCOUNT</code>, you could manually add a tag that expresses that, i.e., a "covers" tag for <code>BANK_ACCOUNT</code> that does not specify a particular routine:
|
||||
The "covers" tags, as you saw earlier, can be generated by AutoTest's New Eiffel Test Wizard when you create a new test. But you could enter the tag manually, as well. For example if you had written a high-level test that exercised all or most of the functionality of the class <code>BANK_ACCOUNT</code>, you could manually add a tag that expresses that, i.e., a "covers" tag for <code>BANK_ACCOUNT</code> that does not specify a particular routine:
|
||||
<code>
|
||||
covers/{BANK_ACCOUNT}
|
||||
</code>
|
||||
@@ -289,7 +289,7 @@ Looking again at the '''Tags''' pane, you will see that there are two boxes unde
|
||||
<code>
|
||||
platform/os/linux
|
||||
</code>
|
||||
Below that box are links that allow you to add certain commonly used or predefined tag types. One of these, '''Add tag for covered class/feature''' is the link we used to add the "covers" tag for our test on <code>{BANK_ACCOUNT}.deposit</code>.
|
||||
Below that box, there are links that allow you to add certain commonly used or predefined tag types. One of these, '''Add tag for covered class/feature''' is the link we used to add the "covers" tag for our test on <code>{BANK_ACCOUNT}.deposit</code>.
|
||||
|
||||
|
||||
===Other predefined tags===
|
||||
@@ -301,7 +301,7 @@ Selecting '''Run test in private evaluator''' will insert the tag:
|
||||
execution/isolated
|
||||
</code>
|
||||
|
||||
When tests are executed, they do so within the context of '''evaluator processes'''. Normally, evaluator processes are reused for multiple test executions. But if you select '''Run in private evaluator''', the tag added to your test guarantees that this test will be run in a fresh evaluator process, that terminates when the test completes. This can be helpful, for example, when you don't want your test to enter or leave the evaluator process with the effects of "once" routines or any other action that might effect the efficacy of other tests. For example, if your test executes external routines which might have a damaging effect on memory, you should run the test in a private evaluator.
|
||||
When tests are executed, they do so within the context of '''evaluator processes'''. Normally, evaluator processes are reused for multiple test executions. But if you select '''Run in private evaluator''', the tag added to your test guarantees that this test will be run in a fresh evaluator process, that terminates when the test completes. This can be helpful, for example, when you don't want your test to enter or leave the evaluator process with the effects of "once" routines or any other action that might affect the efficacy of other tests. For example, if your test executes external routines which might have a damaging effect on memory, you should run the test in a private evaluator.
|
||||
|
||||
If you select '''Run test serially''', the following tag will be inserted:
|
||||
<code>
|
||||
|
||||
Reference in New Issue
Block a user