Sunday, July 19, 2009

GUI Testing Checklist

這裡有一份可以重複利用的GUI Test Case清單,在開發階段Develpor可以先按照這些Test Case自己先跑跑看程式是否有問題,提早解決顯而易見的bug。

節錄:

Windows Compliance Standards

These compliance standards are followed by almost all the windows based application. Any variance from these standards can result into inconvenience to the user. This compliance must be followed for every application. These compliances can be categorized according to following criteria

  1. Compliance for each application
    1. Application should be started by double clicking on the icon.
    2. Loading message should have information about application name, version number, icon etc.
    3. Main window of application should have same caption as the icon in the program manager.
    4. Closing of the application should result in “Are you sure?” message.
    5. Behaviour for starting application more than once must be specified.
    6. Try to start application while it is loading
    7. On every application, if application is busy it should show hour glass or some other mechanism to notify user that it is processing.
    8. Normally F1 button is used for help. If your product has help integrated, it should come by pressing F1 button.
    9. Minimize and restoring functionality should work properl
  2. Compliance for each window in the application
    1. Window caption for every application should have application name and window name. Specially, error messages.
    2. Title of the window and information should make sense to the user.
    3. If screen has control menu, use the entire control menu like move, close, resize etc.
    4. Text present should be checked for spelling and grammar.
    5. If tab navigation is present, TAB should move focus in forward direction and SHIFT+TAB in backward direction.
    6. Tab order should be left to right and top to bottom within a group box.
    7. If focus is present on any control, it should be presented by dotting lines around it.
    8. User should not be able to select greyed or disabled control. Try this using tab as well as mouse.
    9. Text should be left justified
    10. In general, all the operations should have corresponding key board shortcut key for this.
    11. All tab buttons should have distinct letter for it.
  3. Text boxes
    1. Move mouse to textbox and it should be changed to insert bar for editable text field and should remain unchanged for non-editable text field.
    2. Test overflowing textbox by inserting as many characters as you can in the text field. Also test width of the text field by entering all capital W.
    3. Enter invalid characters, special characters and make sure that there is no abnormality.
    4. User should be able to select text using Shift + arrow keys. Selection should be possible using mouse and double click should select entire text in the text box.
  4. Radio Buttons
    1. Only one should be selected from the given option.
    2. User should be able to select any button using mouse or key board
    3. Arrow key should set/unset the radio buttons.
  5. Check boxes
    1. User should be able to select any combination of checkboxes
    2. Clicking mouse on the box should set/unset the checkbox.
    3. Spacebar should also do the same
  6. Push Buttons
    1. All buttons except OK/Cancel should have a letter access to them. This is indicated by a letter underlined in the button text. The button should be activated by pressing ALT
    2. Clicking each button with mouse should activate it and trigger required action.
    3. Similarly, after giving focus SPACE or RETURN button should also do the same.
    4. If there is any Cancel button on the screen, pressing Esc should activate it.
  7. Drop down list boxes
    1. Pressing the arrow should give list of options available to the user. List can be scrollable but user should not be able to type in.
    2. Pressing Ctrl-F4 should open the list box.
    3. Pressing a letter should bring the first item in the list starting with the same letter.
    4. Items should be in alphabetical order in any list.
    5. Selected item should be displayed on the list.
    6. There should be only one blank space in the dropdown list.
  8. Combo Box
    1. Similar to the list mentioned above, but user should be able to enter text in it.
  9. List Boxes
    1. Should allow single select, either by mouse or arrow keys.
    2. Pressing any letter should take you to the first element starting with that letter
    3. If there are view/open button, double clicking on icon should be mapped to these behaviour.
    4. Make sure that all the data can be seen using scroll bar.

Link(pdf):http://members.tripod.com/bazman/download/checklist.pdf

Link(html):http://bazman.tripod.com/checklist.html?button1=GUI+Testing+Checklist

另外附上M$的User Experience Guide,可以作為Review UI時的一份參考文獻。

Link(html):http://msdn.microsoft.com/en-us/library/aa511258.aspx

Link(pdf):http://download.microsoft.com/download/e/1/9/e191fd8c-bce8-4dba-a9d5-2d4e3f3ec1d3/ux%20guide.pdf

Saturday, July 18, 2009

Software Requirement Checklist

在軟體開發流程中,需求分析是初期了解系統範圍(Scope)的一個步驟。在進行設計之前,每個專案成員都要先審閱軟體需求是否已經完備。在實務上,我們可以透過Checklist來化簡審閱的過程,確保軟體需求已考慮周全。
 
 
Requirement Peer Review Checklist
  1. Compliance with standards
    Does the requirements specification comply with ISD or tailored Branch/project-level standards and naming conventions?
  2. Completeness of Specifications
    Does the requirements specification document address all known requirements? Have ‘TBD’ requirements been kept to a minimum, or eliminated entirely?
  3. Clarity
    Are the requirements clear enough to be turned over to an independent group for implementation?
  4. Consistency
    Are the specifications consistent in notation, terminology, and level of functionality? Are any required algorithms mutually compatible?
  5. External Interfaces
    Have external interfaces been adequately defined?
  6. Testability
    Are the requirements testable? Will the testers be able to determine whether each requirement has been satisfied?
  7. Design-Neutrality
    Does the requirements specification state what actions are to be performed, rather than how these actions will be performed?
  8. Readability
    Does the requirements specification use the language of the intended testers and users of the system, not software jargon?
  9. Level of Detail
    Are the requirements at a fairly consistent level of detail? Should any particular requirement be specified in more detail? In less detail?
  10. Requirements Singularity
    Does each requirement address a single concept, topic, element, or value?
  11. Definition of Inputs and Outputs
    Have the internal interfaces, i.e., the required inputs to and outputs from the software system, been fully defined? Have the required data transformations been adequately specified?
  12. Scope
    Does the requirements specification adequately define boundaries for the scope of the target software system? Are any essential requirements missing?
  13. Design Constraints
    Are all stated design and performance constraints realistic and justifiable?

參考資料:

Sunday, July 12, 2009

軟體測試的藝術

線上翻譯:http://sun.cis.scu.edu.tw/~nms9115/articles/testing/
Testing Principles《測試原則》
  1. A necessary part of a test case is a definition of the expected output or result. 每個測試案例中必須定義期望輸出值或結果
  2. A programmer should avoid attempting to test his or her own program. 程式設計師應避免測試他/她自己的程序
  3. A programming organization should not test its own programs. 程式設計團隊應避免測試它自己的程序
  4. Thoroughly inspect the results of each test. 仔細檢查每一項測試結果
  5. Test cases must be written for input conditions that are invalid and unexpected, as well as for those that are valid and expected. 設計測試樣本時,不合理、不被預期的輸入情況,與合理、被預期的輸入情況同樣重要
  6. Examining a program to see if it does not do what it is supposed to do is only half the battle; the other half is seeing whether the program does what it is not supposed to do. 不要只看看程式是否做了它該做的事,更要看看程式是否做了它不該做的事
  7. Avoid throwaway test cases unless the program is truly a throwaway program. 除非你要丟棄程式,否則這個程式使用過的測試樣本不要丟棄
  8. Do not plan a testing effort under the tacit assumption that no errors will be found. 不要基於程式沒有錯誤的假設來做測試
  9. The probability of the existence of more errors in a section of a program is proportional to the number of errors already found in that section. 還存在於程式裡的錯誤和已發現的錯誤數目成正比
  10. Testing is an extremely creative and intellectually challenging task. 測試是一項極具創造性和智力挑戰的任務
以上是節錄二十年前的Myers所定義的軟體測試原則,二十年後的今天似乎都還是依然適用。不過第2, 3點好像和最近的Agile Methodology倡導的UnitTest有所衝突,究竟在實務上要如何在兩者之間抉擇呢?