mirror of
https://github.com/EiffelSoftware/eiffel-org.git
synced 2025-12-07 15:22:31 +01:00
Author:halw
Date:2010-01-19T23:32:35.000000Z git-svn-id: https://svn.eiffel.com/eiffel-org/trunk@403 abb3cda0-5349-4a8f-a601-0c33ac3a8c38
This commit is contained in:
Binary file not shown.
|
After Width: | Height: | Size: 12 KiB |
@@ -0,0 +1,3 @@
|
||||
title=AutoTest user defined tag root
|
||||
author=halw
|
||||
path=content/autotest-user-defined-tag-root
|
||||
@@ -1,11 +1,7 @@
|
||||
[[Property:title|Managing tests]]
|
||||
[[Property:weight|9]]
|
||||
[[Property:uuid|f1e7f63a-dc86-fefb-e669-3e3ea178c596]]
|
||||
|
||||
{{underconstruction}}
|
||||
|
||||
|
||||
The previous sections cover the basics of testing and what it takes to create and use each of the test types supported by the Eiffel Testing Framework. This section will finish things up with some miscellaneous information about testing strategy and hints on using of the Framework.
|
||||
The previous sections cover the basics of testing and what it takes to create and use each of the test types supported by AutoTest. This section will finish things up with some miscellaneous information about testing strategy and hints on using AutoTest.
|
||||
|
||||
|
||||
|
||||
@@ -27,85 +23,67 @@ If you want to delete a single test, you can delete that feature from its test c
|
||||
If you want to remove a whole test set, then [[Removing a class|delete the class]] that defines that test set.
|
||||
|
||||
|
||||
==Using Views and Filters==
|
||||
==Using Filters==
|
||||
|
||||
{{note|The development of this documentation section is currently on hold pending changes to the interface expected in an upcoming release. }}
|
||||
Filtering is provided to help view, manage, and run the tests in a test suite.
|
||||
|
||||
Filtering controls which tests are visible in the AutoTest interface how the view is organized. You can display tests organized by the test classes that contain them, by the classes they target, by their type, by their most recent results, or by any system you set up using a system of [[Create a manual test#About tags|tags]].
|
||||
|
||||
Filtering helps you manage which tests get run during a give execution. You can select certain tests to be run from those visible in the AutoTest interface, or you can choose to run all tests visible through a filter.
|
||||
|
||||
|
||||
Views and Filters are provided to help view, manage, and run the tests in a test suite.
|
||||
===The Filter box===
|
||||
|
||||
Views control ''how'' the view of tests is organized in the Eiffel Testing Framework interface. You can display tests organized by the test classes that contain them, by the classes they target, by their type, by their most recent results, or by any system you set up using a system of [[Create a manual test#About tags|tags]].
|
||||
The Filter box in the AutoTest interface can be used to enter filter text which will allow only certain tests to be visible.
|
||||
|
||||
Filters control ''which'' tests are displayed in the Eiffel Testing Framework interface.
|
||||
Filter text can be a string of characters occurring in specific test class name or test routine name, or it can be a [[Create a manual test#About tags|tag]] or a portion of a tag hierarchy. The Filter box supports regular expressions, so you can filter with more granularity.
|
||||
|
||||
===The View box===
|
||||
It is important to bear in mind that the View box works with the system of [[Create a manual test#About tags|tags]] described in the section on creating manual tests. Tags are hierarchically structured names that are applied to tests through the <code>note</code> clause. When you use the View box to display a set of tests, you specify that set by the tags on the tests. Some of the tags are implicit, in the sense that AutoTest accounts for them, and they are not explicitly coded in <code>note</code> clauses. This should become clear when we look at some examples.
|
||||
|
||||
The View box on the Eiffel Testing Framework can be used to display tests by different criteria. However, the workings of the View box deserve some explanation. If you just try to use View without any background knowledge, you may find it non-intuitive.
|
||||
When the filter text is cleared, the AutoTest interface will display tests accessible through all tag roots.
|
||||
|
||||
It is important to bear in mind that the View box works with the system of [[Create a manual test#About tags|tags]] described in the section on creating manual tests. Tags are hierarchically structured names that are applied to tests through the <code>note</code> clause. When you use the View box to display a set of tests, you specify that set by the tags on the tests. Some of the tags are implicit, in the sense that the Testing Framework accounts for them, and they are not explicitly coded in <code>note</code> clauses. This should become clear when we look at some examples.
|
||||
|
||||
When the View box is displaying a set of tests, the "root" tag(s) for the sub tree of tests is what is visible in the View box. Let's look at some examples.
|
||||
|
||||
If the view box is empty, it will display tests accessible through all root tags. So, using the example we built in the preceding sections, if we just select the blank choice for the View box, here's what we see:
|
||||
As of version 6.5 of EiffelStudio, the tag root words used are:
|
||||
|
||||
|
||||
[[Image:Testing Framework interface View box 01]]
|
||||
{| border="2"
|
||||
|-
|
||||
| class || Tests organized by test classes
|
||||
|-
|
||||
| covers || Tests organized by target classes/routines
|
||||
|-
|
||||
| result || Tests organized by the results of their most recent execution
|
||||
|-
|
||||
| user || Tests organized by type (manual, extracted, generated) and by user-added tag hierachies
|
||||
|}
|
||||
|
||||
|
||||
In the column labeled '''Tests''', you see tree view root words '''class''', '''covers''', '''outcome''', and '''type'''. The view labeled '''class''' means ''"tests as they are structured in their test classes."'' So, if we completely expand '''class''' for our test system, then in the '''Tests''' column we see:
|
||||
{{note|The tag roots will appear only if there are tests that can be categorized under them. For example, if you have not run any tests, then '''result''' will not appear. }}
|
||||
|
||||
|
||||
[[Image:Testing Framework interface View box 02]]
|
||||
Notice that the Filter box has a drop-down with a list of options:
|
||||
|
||||
|
||||
The '''covers''' tag root means ''"tests based on their target classes and target routines."''
|
||||
[[Image:AutoTest filter drop down]]
|
||||
|
||||
|
||||
[[Image:Testing Framework interface View box 03]]
|
||||
These options are shortcuts to the various tag roots listed above:
|
||||
|
||||
|
||||
This shows that there is only one target class <code>BANK_ACCOUNT</code>, and two of its routines are target routines, <code>deposit</code> and <code>withdraw</code>.
|
||||
|
||||
The '''outcome''' tag root means ''"tests categorized by whether they were successful or failing in the most recent run."'' So expanding '''outcome''' we see that all of out tests show up as successful:
|
||||
|
||||
|
||||
[[Image:Testing Framework interface View box 04]]
|
||||
|
||||
|
||||
The '''type''' tag root means ''"tests categorized by type."'' So, if we expand '''types''', we see our tests grouped by '''extracted''', '''generated''' (synthesized), and '''manual''':
|
||||
|
||||
|
||||
[[Image:Testing Framework interface View box 05]]
|
||||
|
||||
|
||||
|
||||
{{note|The tag roots will appear only if there are tests that can be categorized under them. For example, if you have not run any tests, then '''outcome''' will not appear. }}
|
||||
|
||||
|
||||
Notice that the View box has a list of options:
|
||||
|
||||
|
||||
[[Image:Testing Framework interface View box 06]]
|
||||
|
||||
|
||||
These options are shortcuts to the various tag roots that we just discussed:
|
||||
|
||||
#'''Tests''' displays the sub-tree under the tag root '''class'''
|
||||
#'''Results''' displays the sub-tree under the tag root '''outcome'''
|
||||
#'''Test classes''' displays the sub-tree under the tag root '''class'''
|
||||
#'''Results''' displays the sub-tree under the tag root '''result'''
|
||||
#'''Classes under test''' displays the sub-tree under the tag root '''covers'''
|
||||
#'''Types''' displays the sub-tree under the tag root '''type'''
|
||||
#'''User-defined tags''' displays the sub-tree under the tag root '''user'''
|
||||
|
||||
|
||||
Any tagging system that you devise will also show up in the View box. Let's edit our tests and add an additional line of testing information to each with some arbitrary hierarchical tags.
|
||||
Any tagging system that you devise will show up under the '''user''' tag root.
|
||||
|
||||
So, now the manual test now looks like this:
|
||||
For example, consider a manual test containing a '''testing:''' note name with a user-defined tag as in the following code.
|
||||
|
||||
<code>
|
||||
test_deposit_01
|
||||
-- New test routine
|
||||
note
|
||||
testing: "covers/{BANK_ACCOUNT}.deposit"
|
||||
testing: "my_tag_1/my_tag_1_1/my_tag_1_1_1"
|
||||
testing: "my_tag_root" -- My new tag root
|
||||
local
|
||||
l_ba: BANK_ACCOUNT
|
||||
do
|
||||
@@ -114,24 +92,12 @@ So, now the manual test now looks like this:
|
||||
end
|
||||
</code>
|
||||
|
||||
In the extracted test targeting <code>{BANK_ACCOUNT}.withdraw</code> this line has been added:
|
||||
<code>
|
||||
testing: "my_tag_1/my_tag_1_1/my_tag_1_1_2"
|
||||
</code>
|
||||
and in the synthesized test which targets <code>{BANK_ACCOUNT}.withdraw</code> we add this line:
|
||||
<code>
|
||||
testing: "my_tag_1/my_tag_1_2/my_tag_1_2_1"
|
||||
</code>
|
||||
As soon as we compile and set the View box to blank to show all tag roots, we see that the root for our new tag root shows up in the list:
|
||||
This will cause the new user-defined tag and its associated tests to be visible in the AutoTest interface.
|
||||
|
||||
[[Image: AutoTest user defined tag root]]
|
||||
|
||||
|
||||
[[Image:Testing Framework interface View box 07]]
|
||||
|
||||
|
||||
If we expand the tag root '''my_tag_1''' completely, we see our tests arranged according to their values for this tag root:
|
||||
|
||||
|
||||
[[Image:Testing Framework interface View box 08]]
|
||||
{{seealso|The [[The AutoTest Interface#Filtering|Filtering]] section in [[The AutoTest interface]].}}
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user