AI-Powered Developer: Build software with ChatGPT and Copilot cover
welcome to this free extract from
an online version of the Manning book.
to read more
or

6 Testing, assessing, and explaining with large language models

This chapter covers

  • Drafting unit tests with ease
  • Generating integration tests
  • Determining code quality and coverage
  • Assessing software complexity
  • Translating code and text

This chapter will explore a critical aspect of software engineering: testing. The act of testing software serves multiple essential purposes. First and foremost, it aids in the identification of bugs, errors, and problems that can potentially affect the software’s functionality, usability, or performance. Furthermore, it ensures that the software adheres to the required quality standards. By conducting thorough tests, we can verify whether the software meets the specified requirements, functions as intended, and produces the expected outcomes. Through comprehensive testing, developers can evaluate software’s reliability, accuracy, efficiency, security, and compatibility across various platforms and environments. Detecting and resolving software defects early in the development process can result in significant time and cost savings.

Once we have finished formulating our tests, we will evaluate the quality of our code. You will be introduced to several metrics that are helpful in assessing software quality and complexity. Additionally, if we need clarification on the purpose of our code or are reviewing it for the first time, we will seek an explanation to ensure thorough understanding.

6.1 Testing, testing … one, two, three types

6.1.1 Unit testing

6.1.2 Integration testing

6.1.3 Behavior testing

6.2 Assessing quality

6.3 Hunting for bugs

6.4 Covering code

6.5 Transliterating code—from code to descriptions

6.6 Translating from one language to another

Summary