Sobes.tech
Junior

What is the expected behavior during negative testing?

sobes.tech AI

Answer from AI

Expected behavior during negative testing is that the system handles incorrect input data, user actions, or adverse environmental conditions without crashes, data loss, or unauthorized access.

Main scenarios of expected behavior:

  • Display of an informative error message: The user receives a clear and understandable explanation of the problem, for example: "Invalid email format," "Password must be at least 8 characters," "Access to the requested resource is denied."
  • Preventing incorrect operations: The system blocks actions that could lead to errors or undesirable consequences. For example, the "Save" button is disabled until required fields are filled.
  • Reverting to the previous stable state: In case of failure or incorrect operation, the system should revert to the state before the attempt without losing correct data.
  • Logging the error: Information about the incorrect event should be recorded in system logs for subsequent analysis and debugging.
  • Maintaining data integrity: Regardless of incorrect input data, existing information in the database should not be damaged or deleted.
  • No security leaks: Incorrect input data should not lead to unauthorized access or execution of malicious code.

Examples of expected behavior depending on the type of negative test:

Type of negative test Expected behavior
Invalid input format Validation error message, prevention of save/send.
Limit exceeded Limit message, operation blocking.
Missing required fields Error message, prevention of save/send.
Deletion of used object Warning or blocking of deletion if a dependent object still exists.
Incorrect access rights Access denied message.
Attempt to perform a prohibited action Access rights error message or inability to perform action.