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































