liveBook · Manning

Accuracy

As explained in Software Testing with Generative AI

Accuracy is a quality characteristic concerning whether software produces correct results and represents information correctly.

Accuracy is a software quality characteristic concerned with producing correct results and representing information correctly. In testing and development, it turns vague concerns about correctness into questions, validation needs, and code risks. section 4.4.1 section 4.4.5

Apply accuracy to focused testing tasks:

  • Clarify ambiguous user stories and acceptance criteria by asking what precision, validation, and handling of invalid data are required. section 4.4.1 section 4.2.1
  • Inspect implementation risks such as overwriting an existing duration instead of correcting it, or accepting data that creates inconsistent behavior. section 4.4.5
  • Separate accuracy from related concerns such as consistency, then state the required output format so findings remain testable and reviewable. section 4.4.1

Timesheet requirements

For a timesheet that records project time in half-hour units, accuracy questions include: What precision is required? How are invalid entries handled? What validation prevents incorrect time data? These questions expose requirements that the user story leaves unspecified. section 4.4.1

###
public class Timesheet {
 
    private HashMap<String, Integer> timesheets = new HashMap<>();
 
    public boolean submitTimesheet(String projectName, int duration) {
        if (projectName != null && duration > 0) {
            // Check to see if project already exists
            if (timesheets.containsKey(projectName)) {
                // If it does, add the new duration to the
                // existing total
                duration += timesheets.get(projectName);
            }
            timesheets.put(projectName, duration);
            return true;
        } else {
            return false;
        }
    }
 
    public Collection<Integer> getTimesheets() {
        return timesheets.values();
    }
 
    public int getTotalTimesheetHours(String projectName) {
        return timesheets.get(projectName);
    }
}
###

Review the Java implementation for accuracy risks: adding a new duration to an existing total may make corrections inaccurate, even when the input passes basic validation. section 4.4.5

How Software Testing with Generative AI covers it

How deep it goes
Develops accuracy through structured questions and code-risk analysis, stopping short of prescribing complete tests or fixes.
Examples
Demonstrates accuracy with timesheet requirements, half-hour durations, invalid entries, and Java duration-accumulation logic.
What it assumes
Assumes familiarity with user stories, acceptance criteria, software testing, and basic Java code.
What you can do after
Evaluate generated questions and code risks to find unclear accuracy requirements and possible incorrect results.
How it connects
Connects accuracy with consistency, validation, acceptance criteria, user stories, and code analysis.

Also explained in

Compare how 32 books explain accuracy →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Software Testing with Generative AI. The section links point to the parts of the book it draws on.