tailieunhanh - Phát triển Javascript - part 9
Tham khảo tài liệu 'phát triển javascript - part 9', công nghệ thông tin, kỹ thuật lập trình phục vụ nhu cầu học tập, nghiên cứu và làm việc hiệu quả | Summary 53 Although we visited the topics of test coverage reports and continuous integration in this chapter no setup or examples were given for such tools. On the book s website1 you will find a guide to running the Coverage plugin for JsTestDriver as well as a guide on how to run JsTestDriver tests in the open source continuous integration server Hudson. In the next chapter we will have a look at some other ways to utilize unit tests before we move on to Part II JavaScript for Programmers. 1. http Download from This page intentionally left blank Download from TpettnTrarn Test to Learn I n the previous three chapters we have seen how automated tests can help improve quality of code guide design and drive development. In this chapter we will use automated tests to learn. As small executable code examples unit tests make a perfect learning resource. Isolating a specific aspect of an interface in a unit test is a great way to learn more about how it behaves. Other types of automated tests can help our understanding of both the language and specific problems. Benchmarks are a valuable tool to measure relative performance and can guide decisions about how to solve a specific problem. Exploring JavaScript with Unit Tests Quickly executing JavaScript as in executing a few lines of script to explore the behavior of some object is fairly simple. Most modern browsers ship with a console that serves this purpose just fine. Additionally there are several options for JavaScript command line interfaces when the browser environment is not of particular interest. Although this sort of one-off coding session can help our understanding of an interface it suffers from the same problems that manual application testing does. There is no way to repeat a given experiment there is no record of previously run experiments and there is no simple way of repeating an experiment in multiple browsers. In Chapter 1 Automated Testing we .
đang nạp các trang xem trước