TESTAR Oracles ideas - TESTARtool/TESTAR_dev GitHub Wiki

Implicit oracle and action extension ideas implementation status overview

ID Oracle or action idea Labels Implemented for Coud be implemented for
0 Suspicious message oracle ErrorsInOutput, Text Desktop, Web Desktop, Web
1 Check that after choosing an item in dropdownlist, the item should have the chosen value SmallPattern   Desktop, Web
2 Detect growing database tables Data, DB, Grow, Performance   Desktop, Web
3 Save and close button should toggle enable when changes are made in a form SmallPattern Web Desktop, Web
4 Use accent (') character in text fields Security, SpecialCharacter, Parsing Web Desktop, Web
5 Type invalid XML in inputfield, such as ‘ bla bla bla’. Security, SpecialCharacter, Parsing Web Desktop, Web
6 Detect Unicode Replacement Character for special characters such as é € ý ì SpecialCharacters, Conversion, Parsing Web Desktop, Web
7 Select different configuration schemes Environment Web Desktop, Web
8 Widget clash detection Visual Web Desktop, Web
9 Search on an unreal value (such as a random Guid value) should not show results in a search form Data, SmallPattern   Desktop, Web
10 Save and close should always close form or give a validation error Data, SmallPattern   Desktop, Web
11 Grammar or spellchecker integration Text Desktop, Web Desktop, Web
12 Dropdown lists with only one item can be suspicious Data, OneItem, List Web Desktop, Web
13 Dropdown list under scrollbar Visual   Desktop, Web
14 Detect actions that are (very) slow Performance   Desktop, Web
15 Repeat actions, especially actions which add new data SmallPattern   Desktop, Web
16 Detect that webpage is continuous refreshing UnexpectedBehavior   Web
17 Detect browser differences Difference, Compare   Web
18 Detect that items in a dropdownlist are not sorted alphabetically Data, Sorting, List Desktop, Web Desktop, Web
19 Detect that form size changes while entering values in a form SmallPattern   Desktop, Web
20 Detect dummy button SmallPattern, Empty, Difference, Compare, Button Desktop, Web Desktop, Web
21 Check that focus is set on first field in a form SmallPattern, UX   Desktop, Web
22 Detect records in export or grid that contains inactive records or records which should not be export or shown because a user does not have permissions to see these records. Data, Security Web Desktop, Web
23 Upload of document (file) is required to test a lot of document management related paths. SmallPattern, File   Web
24 Long text as input to test the application for overflow exceptions Data, LongText Web Desktop, Web
25 Detect that form has no title Tekst, Dialog Desktop Desktop, Web
26 Detect that actions are not allowed by the logged in user Security   Desktop, Web
27 When a form is cancelled, then program should go to previous state SmallPattern   Desktop, Web
28 Detect that images in an application (or report / document) are not in their native resolution. Visual, UX Web Desktop, Web
29 An agent (deamon service) logs errors in the background. These errors are logged with Log4Net (port of Log4J) into a log file, Windows event log, Network listener, or other way Log4Net provides. ErrorsInOutput, File   Desktop, Web
30 Detect visual errors Visual, UX Desktop, Web Desktop, Web
31 Run TESTAR simultaneously on the same database to mimic a multi-user environment and therefore try to find errors that has to do with concurrency, deadlock, optimistic and pessimistic locking, performance, caching, etc. Environment, MultiUser   Desktop, Web
32 Detect differences between current and previous version (known good) of SUT Difference, Compare   Desktop, Web
33 Popup is not completely in viewport of browser Visual, UX   Web
34 Detect html tags in certain fields/output Data, Text, SpecialCharacters, Parsing Web Desktop, Web
35 Modify host system of SUT by TESTAR, such as disconnect network connection, restart, hibernate, shutdown SQL server, and so on. Environment   Desktop, Web
36 Detect required fields, leave them empty, complete form. Form should not close but give validation errors. SmallPattern   Desktop, Web
37 Splitter location and/or open/closed panels should be saved and restored SmallPattern, Remember, UX   Desktop, Web
38 Detect memory usage and CPU usage over time Performance   Desktop, Web
39 Duplicate menu items / unnumbered lists Data, Duplicates, Menu, List Web Desktop, Web
40 Detect repeating text in text values Data, Duplicates, Repeating, Tekst Web Desktop, Web
41 State should be the same after a refresh of the browser SmallPattern, Remember, UX   Web
42 Detect that a specific icon / image is used somewhere in the application Visual, Duplicates   Desktop, Web
43 Detect controls without accompanying label text Accessability, UX Desktop, Web Desktop, Web
44 Detect that a dropdownlist has a lot of items Data, Performance, UX, List, TooMany Web Desktop, Web
45 Detect that text wrapping is not correct Text, UX, Visual   Desktop, Web
46 Detect that a confirmation dialog has no question mark in the text Text, Dialog   Desktop, Web
47 Detect performance differences between previous versions of SUT Difference, Compare, Performance   Desktop, Web
48 Detect numbers with more than 2 decimals Text, UX, Visual Web Desktop, Web
49 Detect that changes are not logged into change log after hitting (specific) Save buttons Data, SmallPattern, InSync   Desktop, Web
50 Detect that no text can be typed due the maxlength property of input field is set to zero Data, Text, Limitation Web Web
51 Detect that dropdownlist has no items, thus is empty Data, Empty, List Web Desktop, Web
52 Detect a radiobutton group with only one available option Data, OneItem, List Web Desktop, Web
53 Detect duplicate records in database Data, Duplicates, List, DB   Desktop, Web
54 Detect that text in widget is horizontally cut off Text, Visual   Desktop, Web
55 Detect that settings are not stored (saved) SmallPattern, Remember   Desktop, Web
56 Detect that sorting function in a grid doesn’t work Data, Sorting, List   Desktop, Web
57 Detect suspicious alert messages, such as a login or error message SmallPattern, AlertMessage, Dialog Web Web
58 Detect that exact same popup or message or form is shown after each other UX, Duplicates   Desktop, Web
59 Detect a panel or group without visible widgets Visual, Empty Desktop, Web Desktop, Web
60 Detect that text has the same color as the background color and therefore invisible for a user (invisible text detection) Visual, UX, Accessability   Desktop, Web
61 Detect database queries that are exactly the same and are repeated more than x time in a sequence of actions Data, Duplicates, Log, DB, File   Desktop, Web
62 When key is pressed in a multiline text widget, then the focus should stay in the multiline widget SmallPattern, UX   Desktop, Web
63 Detect that multiple (i.e. more than 10) equal processes are started Environment, Duplicates   Desktop
64 Detect queries that return a large recordset and/or are slow Data, Performance, List, TooMany, Log, DB   Desktop, Web
65 Detect that an empty (0 bytes) file is downloaded or saved Data, Empty, File Web Web
66 Detect that a non-required fields appear to be required Data, SmallPattern, Validation   Desktop, Web
67 Detects that log files contain repeated messages. This could lead to inefficient behavior of the SUT or that the program is hanging (looping). Data, Duplicates, List, Log, File   Desktop, Web
68 Detect that text is not copy and pastable in other text field Data, Text, UX, Clipboard   Desktop, Web
69 Detect that menuitem remains after click on or next to a menuitem SmallPattern, UX, Menu   Desktop, Web
70 Detect that duplicate rows in a grid are shown Data, Duplicates, List, Grid Web Desktop, Web
71 Detect that it is not possible to select multiple values in a MultiQuickLookup Data, SmallPattern, Multiselect   Desktop, Web
72 When an export file is downloaded (such as Excel, XML, CSV), then look for duplicated rows in the file. The expectation is that there shouldn't be any duplicated rows in such a file. Data, Duplicates, List, File Web Web
73 Detect the lack of action queries in the database when data should be expected to saved Data, SmallPattern, Log, DB   Desktop, Web
74 Detect that Save (and Close) button still works while it should not be when there are validation messages. Check that there are no action SQL queries (see idea 73). Data, SmallPattern, Validation, Log, DB   Desktop, Web
75 Detect that sensitive data is visible in UI, log, database, export, or configuration files Data, Security, Log, File, UX Web Desktop, Web
76 ‘Delete row’ button should not be visible when a grid has no rows UX, InSync   Desktop, Web
77 Detect that last search term is not restored when a user opens the search form the next time SmallPattern, Remember, UX   Desktop, Web
78 Detect that following record is not selected after deletion of current record Data, SmallPattern, UX   Desktop, Web
79 Detect that texts values are not in sync Text, InSync Web Desktop, Web
80 Detect that actions which should be the same react differently Menu, InSync, Compare, Difference   Desktop, Web
81 Detect files without file extension on filesystem or e-mail attachments File, Text Web Web
82 Detect calculation errors in calculated fields. Text, InSync, Compare   Desktop, Web
83 Detect that menus that should have the same menuitems are not equal Menu, InSync, Compare, Difference   Desktop, Web
84 Detect if a grid has multiple rows and columns containing non-empty text which are all the same Data, Duplicates, List, Grid Web Desktop, Web
85 Detect common confirmation questions from browser Text, Dialog, AlertMessage, Text   Web
86 Detect a modal dialog and expect that certain buttons should be available Dialog, Button, Text   Desktop, Web
87 Detect that screen size and positions are not remembered SmallPattern, Remember, UX, Dialog   Desktop
88 Check that focus stays in widget after selecting a value in the widget SmallPattern, UX   Desktop, Web
89 Detect duplicate items in dropdownlist Data, Duplicates, List Web Desktop, Web
90 Detect common suspicious text, characters or words Text, Common Web Desktop, Web
91 Detect datetime picker widget and test it for common implementation of such widget SmallPattern, UX, Common   Desktop, Web
92 Detect that combobox cannot be cleared with delete and or backspace SmallPattern, UX   Desktop, Web
93 Listen to 0 or more e-mailboxes and check for incoming e-mails. Can be used to detect spell checking errors, error messages, empty e-mails. Or only check that an e-mail message should come in. ErrorsInOutput, Tekst, File, Email   Desktop, Deamon
94 Detect number with or without decimals (and currencies) that should not be shown when value is zero Text, UX, Visual Web Desktop, Web
95 Detect issues with Chrome Lighthouse report functionality ErrorsInOutput, Log, Text, Visual, Accesability, Performance   Web
96 Closing a form with unsaved changes should ask user to save or decline changes Data, SmallPattern, Validation, Dialog   Desktop, Web
97 Detect error, warning, information, verbose message of console of browser ErrorsInOutput, Log, Text, Visual Web Web
98 Detect untranslated text Text Web Desktop, Web
99 XSS injection attack Security, SpecialCharacter, Parsing Web Web

Oracle verdict implementation example

0: Suspicious message oracle

The suspicious message oracle is the built-in oracle that is supplied with TESTAR. This oracle should be used to detect error messages which a SUT can give. Some of the other oracle ideas can trigger error messages; therefore, it is important to always implement this suspicious message oracle.

Examples: Text containing words like 'Exception', 'Error', 'Problem' or translations of these words if the program is in another language. Next there are probably false positives which should be excluded, such as a message containing the text 'Validation error'.

Implementation Web and Windows Tags that could be used for suspicious messages are:

Title;WebName;WebTagName;Desc;WebTextContent

The suspicious message verdict works with a matching regular expression, which can be configured in the TESTAR user interface.

Example:

Protocol usage example The text with words Error, Exception, Exceptie, Fout, Probleem and Violation are suspicious, then exceptions to these rules are Validation error and Documents with error code. This list should be tailored for the System Under Test.
^(?=.*[eE]rror.*|.*[eE]xcepti[o?]n.*|.*[Ee]xceptie.*|.*[fF]out.*|.*[pP]robleem.*|.*Violation.*)(?!.*[vV]alidation error.*|Documents with error code).*

3: Save and close button should toggle enable when changes are made in a form

On a detail page, a user can edit input fields. If a user does that, the Save (and Save and close) buttons should be enabled. When this button is enabled, the user can see unsaved changes. If the detail is for the new record, then the default state of the save buttons is enabled because the new record is not saved yet.

Examples:

  • Fields not saved by switching in the navigation tree
  • The ’Save’ button is immediately enabled when leaving a telephone field. This bug is the other way around. A user clicks on a field and does not make changes, but the Save button is enabled when it should not be.
  • MultiLineTextBox does not respond to cut/delete. The user selects ‘cut’ to the clipboard. Save and close button should be enabled because a change has been made in the content of a textbox.
  • Enable save buttons do not always go well

Implementation Web

private Verdict formButtonEnabledAfterTypingChangesVerdict(State state)

public static Verdict formButtonMustBeDisabledIfNoChangesVerdict(State state)

Protocol usage example
@Override
protected Verdict getVerdict(State state) {
	// Obtain suspicious title verdicts
	Verdict verdict = super.getVerdict(state);

	// Check the functional Verdict that detects if a form button is disabled after modifying the form inputs.
	verdict = formButtonEnabledAfterTypingChangesVerdict(state);
	if (shouldReturnVerdict(verdict)) return verdict;

	// Check the functional Verdict that detects if a form button is enabled when it must not.
	verdict = formButtonMustBeDisabledIfNoChangesVerdict(state);
	if (shouldReturnVerdict(verdict)) return verdict;

	return verdict;
}

4: Use special characters such as accent (') in text fields

In programming languages, a lot of special symbols are used, such as '"<>!@#$%ˆ&*()_+ characters. If the user input is not correctly validated or cleaned some weird behaviour could be raised in the application. Some hacking techniques like SQL injection also use this to find their way into an application.

Examples

  • Wrong extranet user generated if search name contains '
  • Document preview cannot be displayed if subject contains % sign
  • Strange character is not possible in e-mail addresses
  • Name cannot begin with '#' character, hexadecimal value 0x23

Consider the following sql statement construction:

string sqlQuery = "SELECT * FROM Person WHERE Name LIKE '%" + textFromSearchField + "%'";

The variable textFromSearchField is retrieved from an inputfield where a user can type any text. If this text is a single quote character, the query which will be constructed is:

SELECT * FROM Person WHERE Name LIKE '%'%'

This statement is now syntactically incorrect and will cause an exception on the SQL server. This is often not propagated to the end user, but for instance, a web application will give a 500 Internal Server error response.

A similar character is the '@' character because it is often used to indicate parameter placeholders in SQL statements.

SELECT * FROM Person WHERE ID = @p0

In the table below are some more examples of characters which could raise issues in a SUT.

Input Reason
Could trigger a SQL injection vulnerability in the SUT. Microsoft SQL Server uses a single quote for text in queries.
Could trigger a SQL injection vulnerability in the SUT. Microsoft Access uses a double quote for text in queries.
@# Could trigger a SQL injection vulnerability in the SUT. Parameters in queries are often prefixed with a @ sign.
01-01-2023 Dutch date notation. Some forms in DigiOffice require a Dutch date in the past and enhance the exploring capability.
31-12-2023 Dutch date notation. Some forms in DigiOffice require a future Dutch date and enhance the exploring capability.
15-09-200 Dutch date notation for September 15th in the year 200. This could raise a Microsoft SQL exception if this input is not validated: An exception was caught during the execution of a retrieval query: SqlDateTime overflow. Must be between 1/1/1753 12:00:00 AM and 12/31/9999 11:59:59 PM.
A (261x) Concatenation of 261 ’A’ characters creates a long text input and may raise an overflow exception if the input needs to be validated or truncated. Database fields often have field lengths lower than 256 characters.
’ OR 1=1 OR ”=’ Common SQL injection hack where all records could be exposed if SUT is vulnerable. This could lead to security and/or performance issues.
<script>console.error(’XSS is possible’); </script> Harmless XSS injection script. When this input is accepted and executed somewhere else in the SUT, then the error message ’XSS is possible’ is written to the console log and noticed by the Web browser console log oracle.
<memo>alpha beta gamma Invalid XML. Opening XML tag memo without a closing tag. This could raise parsing exceptions if the input is not parsed correctly.
{100} Common notation for using arguments while formatting strings with String.Format method in C#. If this text is not parsed safely and is used in a formatting function without 101 arguments, then is will throw: System.FormatException: Index (zero based) must be greater than or equal to zero and less than the size of the argument list.
Chinese Unicode character. Which means South. If Unicode characters are not supported, then this will be shown as a question mark (?) or Unicode Replacement character. The Unicode Replacement character can be detected by an implicit test oracle.

Implementation Windows and Web This is implemented by adding the accent (’) to the custom_Input_data.txt file in the settings directory and use a pasteTextInfo (listing 3) action which gets inputs from the file. The custom_input_data.txt contains all kinds of weird strings, including quote/accent.

Protocol usage example
actions.add (ac. pasteTextInto (widget, InputDataManager.getRandomTextFromCustomInputDataFile (
  System.getProperty (" user .dir ") + "/ settings / custom_input_data .txt"), true ));

protected Set deriveActions(SUT system, State state) throws ActionBuildException

5: Type invalid XML in inputfield

Invalid XML could be a phrase such as <memo>alpha beta gamma. The phrase has an opening <memo> XML tag, but no </memo> end tag. If the text is put through an XML parser, then this would raise an exception. There could also be a security issue because this phrase could show an XML Injection issue. After all, the input should be escaped before it is written as XML.

Implementation Web and Windows Similar as 4.

6: Detect Unicode Replacement characters for incorrect parsed Unicode characters.

Special characters such as é € ý ì could be transformed into a � Unicode Replacement Character, which is often shown as a white question mark on black rhombus because it was unable to render the correct character.

Examples bugs:

  • Question mark ’?’ as workflow comment shows parser error
  • é,è,í,ö,ü characters are converted to �,�,�,�,� during registration profile refresh
  • Change special characters in the signature after changing data
  • Unicode characters are not placed correctly in e-mail

Implementation Web and Windows

Implementation is twofold. First, some Unicode characters should be added as input characters, see 4. Second, a detection verdict is needed to detect if a Unicode Replacement Character is found by using the regular expression .*\uFFFD.*.

public static Verdict UnicodeReplacementCharacter(State state, Tag tagTextChecker)

Protocol usage example
@Override
protected Verdict getVerdict(State state) {
	// Obtain suspicious title verdicts
	Verdict verdict = super.getVerdict(state);

	// Check The replacement character � (often displayed as a black rhombus with a white question mark) is a symbol found in the Unicode standard at code point U+FFFD in the Specials table. It is used to indicate problems when a system is unable to render a stream of data to correct symbols
	verdict = GenericVerdict.UnicodeReplacementCharacter(state, WdTags.WebTextContent);
	if (shouldReturnVerdict(verdict)) return verdict;

	return verdict;
}

7: Select different configuration schemes

If an app has configuration settings which are not (easy) available in the GUI then it may be worthwhile to let TESTAR startup a different configuration.

For example:

  • different users with different (user) settings and different permissions
  • module options on or off
  • different (common) customer configurations

Example bugs:

  • Error message when opening page ’Overviews ->Main projects’
  • If a customer does not have a licence, the buttons X and Y are still visible
  • If a user has no rights to use feature X, two buttons are still visible on the toolbar

Implementation Web and Windows

Before each sequence, customise the user permission/role (login, database, etc.).

Some generic implementations could be that TESTAR runs on multiple machines where it is logged in as different users with different configuration schemes/permissions. Or by running a batch file or PowerShell file before any sequence to configure the SUT in a different setting.

8: Widget clash detection faults

Detect widgets are completely or partially overlapping each other. When widgets overlap, then parts of the text or input control are not visible or not visible at all (while they should be visible).

Example bugs:

Group title and navigation hyperlink overlap on Sitemap page in ParaBank.

Group title and navigation hyperlink overlap on Sitemap page in ParaBank.

Two buttons overlap on About us page in ParaBank

Two buttons overlap on About us page in ParaBank

Implementation Web and Windows

The overlap detection is implemented using the following idea. We assume that every widget should be contained in all its parent widgets to be visible to the user. If a child widget is not fully contained, then it is skipped for clash detection because it will not be shown in the GUI. Such a widget is out of the viewport of the parent widget. A parent widget should also be contained by its parents; this is a recursive calculation until there is no parent any more or a widget is not contained by its parent. After building this list of widgets that are contained (and thus visible), the clash detection on all levels can start for widgets that do not have a parent-child relationship. The clash is detected when the rectangles of two widgets are wholly or partially overlapped.

While implementing this idea for a web application, widgets are sometimes visible outside of the rectangular area of their parent. This breaks the basic idea that a widget should be bound by its parents. In HTML/CSS it is possible to have a child widget has a fixed or static position or where the parent widget does not constrain its child. For example a parent DIV element with style overflow: visible means that child elements are shown even when they cross the boundaries of the parent widget. Or when a child widget has a style position: fixed, which means it will have a fixed position on the screen and not in the parent container element. There may be more options, but these were often found in the SUT.

While developing the oracle idea there were some cases where widgets are supposed to overlap with other widgets. Examples are a DateTime picker which shows a calendar, a dropdown list, a menu system, a ’program is loading’ message, a hint, a splitter, a modal dialog, etc... These widgets should be whitelisted because they will give a lot of false positives otherwise. We could not think of a generic rule to skip those types of widgets. The only option is to make a SUT-specific whitelist of widgets that are allowed to clash with other widgets by specifying their Role or Class names to the clash detection function.

When a clash is detected between two widgets it is important to present this in a convenient way in the HTML report. To visualize the clashes in the GUI we borrow the visualization of Building Information Modelling software Autodesk Revit. This software can detect clashes in building elements. This software grey out all the building elements except the clashing element. The clashing elements get a vivid color such as yellow, green or purple.

We transplant this coloring idea to the presentation of widget clashes into TESTAR by converting the color screenshot to grey colors and drawing the clashing widgets as overlays with transparent colored overlays. The clashing parts will get the mixed color of the two colors. We choose blue and red, so it will become purple, see figure in its normal form and 66 when TESTAR reports clashes.

Normal coloring in example page:

Normal coloring in example page

Clashing detection coloring in example page:

Clashing detection coloring in example page

public static Verdict WidgetClashDetection(State state, List ignoredRoles, List ignoredClasses, boolean joinVerdicts, boolean checkLeafWidgetsOnly, boolean checkWebStyles)

Protocol usage example
@Override
protected Verdict getVerdict(State state) {
	// Obtain suspicious title verdicts
	Verdict verdict = super.getVerdict(state);

        // Check the functional Verdict that detects if two widgets overlap
	// Also, add the roles or the classes of the widget sub-trees are needed to ignore
 	verdict = GenericVerdict.WidgetClashDetection(state, 
			Arrays.asList(WdRoles.WdCOL, WdRoles.WdCOLGROUP), // ignoredRoles, 
        Arrays.asList(
                /* whitelist: */
                    "multipleFindsWrapper",
                    "workspace-wrapper",
                    "modalOverlay",
                    "cke", // CKE editor 
                    
                /* temporary until bug solved: */
                    "main-page-preview",
                    "ad",
                    "navImageContainer",
                    "workspace-container",
                    "workspace-toggler"
                             ), //ignoredClasses
                true,   // joinVerdicts	
                false,  // checkOnlyLeafWidgets
                true);  // checkWebStyles	
 		if (shouldReturnVerdict(verdict)) return verdict;

	return verdict;
}

11: Grammar or spellchecker integration

You can use a grammar or spellchecker for GUI widgets which have text. A grammar and spelling checker is very powerful in detecting all kinds of issues, not only for normal spelling or grammar issues but also for detecting invalid output, such as unparsed HTML markup or comparable programmatic code in text widgets. Even missing variables in a formatted string could be spotted because the message contains multiple spaces. If the SUT supports multiple interface languages, then there could be issues that words or sentences are not translated into the correct language.

Examples bugs:

  • The translation key ’ThereAreMenuItemsForThisMenu’ is not translated.
  • Title of dialog has the key ’RelationOrPerson’ instead of the translated value.
  • The e-mail template uses the fixed Dutch ’Kamer van Koophandel’ instead of ’Chamber of Commerce’.
  • The Dutch word ’Geexporteerd’ should have been ’Geëxporteerd’.
  • Log file contains misspelt word 'verkwerken' instead of 'verwerken'.
  • User language is changed, but the application is not looking at this setting and shows the user interface in the wrong language.
  • A strange text ’fas fa-clipboard-list’ is shown while hovering over an item.

Implementation Web and Desktop

The grammar and spelling checker library JLanguageTool is used because this library can be easily integrated and embedded into TESTAR. It is very fast and doesn’t need internet service to check texts. There may be more available libraries, but because we don’t have experience checking the GUI with a grammar and spelling checker, we use a pragmatic approach by trying out one first. The grammar and spelling checker is a generic verdict and could be used for all GUI applications that TESTAR supports.

While testing the grammar and spelling checker with a SUT results in too many fault reports. This is because the checker is also checking user data, such as names of persons, businesses and documents. Next to the end-user data also SUT specific words and acronyms. In the management part of the SUT a power user can write C# and PowerShell scripts write HTML/Stringtemplate/XML markup and configure all kinds of fields and properties. This led to an enormous amount of what we consider false positives that the real spelling issues cannot be easily detected. By creating an ignore list (whitelist) of words and phrases in a text file the list gets more manageable. The new reported words and phrases are automatically added to this text file with the prefix ’//’. The tester could open this file and look for all the lines starting with this prefix and decide to fix the spelling error or whitelist the word or phrase. For a small or new application with limited text and user data, the spelling checker is probably valuable in its current implementation, but for this SUT there is more work to be done.

For example, JLanguageTool can be configured to fine-tune it for GUI testing by enabling/disabling specific grammar or spelling checker rules, adding words to the dictionary of JLanguageTool instead of using an ignore list, making a distinction between user entry data, configuration data and labels of widgets, and/or defining special spelling or grammar rules for graphical user interfaces.

public static Verdict SpellChecker(State state, Tag tagTextChecker, Language languageChecker, String ignorePatternRegEx)

Protocol usage example
@Override
protected Verdict getVerdict(State state) {
	// Obtain suspicious title verdicts
	Verdict verdict = super.getVerdict(state);

	Verdict spellCheckerVerdict = GenericVerdict.Spellchecker(state, WdTags.WebTextContent, new Dutch(), Arrays.asList(WdRoles.WdLABEL), Arrays.asList("t"), "");
	if(spellCheckerVerdict != Verdict.OK) HTMLStateVerdictReport.reportStateVerdict(actionCount, state, spellCheckerVerdict);
	return verdict;
}

Example usage in DigiOffice

39: Duplicate menu items

Detect duplicated items in an unnumbered list (UL)

GOOD:

  • One
  • Two

BAD:

  • One
  • One

Presenting a user with multiple (menu)items in a list with precisely the same display value makes no sense. The user cannot distinguish one item from another. The underlying bug could be a technical issue (i.e. all or some items have an 'undefined' value) or is functional, such as the items should have a more distinguishable display value.

Implementation Web
public static Verdict DuplicateULItems(State state)

Protocol usage example
@Override
protected Verdict getVerdict(State state) {
	// Obtain suspicious title verdicts
	Verdict verdict = super.getVerdict(state);

	// Check the functional Verdict that detects Unnumbered List (UL) child elements with duplicate items to the current state verdict.
	verdict = WebVerdict.DuplicateULItems(state);
	if (shouldReturnVerdict(verdict)) return verdict;

	return verdict;
}
⚠️ **GitHub.com Fallback** ⚠️