liveBook · Manning

Security

As explained in Software Testing with Generative AI

A quality characteristic concerning protection against unauthorized access, misuse, alteration, disclosure, or loss.

Security is a quality characteristic used to identify risks involving unauthorized access, misuse, alteration, disclosure, or loss. In code review, it is analyzed alongside performance and interoperability through explicit, structured prompts. section 4.2.2

A focused risk-analysis prompt can:

  • Ask a software testing expert to inspect delimited code and identify risks. section 4.2.2
  • Require each result to follow Risk - Quality Characteristic - Explanation. section 4.2.2
  • Use few-shot examples, such as a large-integer buffer-overflow risk, to establish the expected structure. section 4.2.2

Security risk in booking code

A booking method validates dates, checks conflicts, creates a record, and posts a message. Analysis should consider security together with performance and interoperability, while treating generated risks as suggestions requiring assessment rather than unquestioned findings. section 4.2.2

###
public BookingResult createBooking(Booking bookingToCreate) throws
➥SQLException {
    if(dateCheckValidator.isValid(bookingToCreate.getBookingDates())) {
        if (bookingDB.checkForBookingConflict(bookingToCreate)) {
            return new BookingResult(HttpStatus.CONFLICT);
        } else {
            CreatedBooking createdBooking = 
            ➥bookingDB.create(bookingToCreate);
 
            if(bookingToCreate.getEmail() != null && 
            ➥bookingToCreate.getPhone() != null){
                MessageBuilder messageBuilder = new MessageBuilder();
                Message message = messageBuilder.build(bookingToCreate);
 
                messageRequests.postMessage(message);
            }
 
            return new BookingResult(createdBooking, 
         ➥HttpStatus.CREATED);
        }
    } else {
        return new BookingResult(HttpStatus.CONFLICT);
    }
}
###

Inspect the booking implementation used to demonstrate structured code-risk analysis. section 4.2.2

How Software Testing with Generative AI covers it

How deep it goes
Defines security as a risk category and demonstrates prompt structure, but stops short of detailed security-testing procedures.
Examples
Uses a buffer-overflow example and a booking method containing validation, database, and message-posting operations.
What you can do after
Diagnose candidate security risks by applying a structured prompt to delimited code and reviewing the resulting explanations.
How it connects
Connects security with performance, interoperability, code analysis, and few-shot prompting.

Also explained in

Compare how 28 books explain security →

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.