Скачать 3.51 Mb.
Read this—it’s not the usual “yadda yadda yadda”.
TODO: should we replace this with a non-borrowed icon?
Test-first is rapidly becoming the leading software implementation technique. GUIs, by nature, resist any kind of test, and strongly resist test-first. This book proposes that a lean, right-sized test rig, grown with its target GUI, and using the same tools, can efficiently streamline development.
Chapter 1: The GUI Problem
The reasons to write test cases before writing production code are simple yet subtle. The most compelling reason is to keep software easy to change over time. You might know how to write a new function, now, without its test, but a long time from now you might not realize how a change to another module could break this function. Nobody has perfect memory, and no team has perfect communication. Invest your understanding of your new function, now, into test cases that will raise an alarm if something breaks later. Run all the tests all the time. These simple rules boost development speed, while reducing the odds of debugging.
A recurring theme of this book is test cases must grow cheap and easy to write. When we test new code, as it grows, natural laziness provides simple and cheap tests. Each test case wants to test only one small behavior, so the tested function must have simple inputs and outputs. The test case should not construct every object in your program just to call that function. So that function will grow to decouple from other influences.
The most subtle and powerful effect of test-first is “emergent design”. Tests help your classes decouple from each other, when each test case shows a class performing alone without excess help from other classes. Decoupled classes are easy to change without affecting other classes. Designs that frequently change, under test, become very robust and flexible. This effect is easy to do and hard to talk about. It’s the main reason we take such small steps between each test run. Future chapters will illustrate some counterintuitive decisions, and will explain them with somewhat terse jargon.
This chapter uses a question and answer format to introduce that jargon. This early in the book, only thin metaphors and incomplete rationales can explain how to leverage testing. We must briefly reveal why test-first for GUIs is hard but important, and how programs with GUIs can improve their architecture to avoid complex techniques. The devils are in the details, and the next chapters will exorcize those.
|Dedicated to Ashley & Iris||Abramovitz, Janet N., and Ashley T. Mattoon. 1999|
|Plastics and the Environment. Hoboken. N. J. Wiley-Interscience. Ashley, S. 2002||Gilliland home is dedicated|
|Citations Acknowledging or using iris-related facilities and Data As of August 2010 Please send corrections and/or additions to||Dedicated to Jerry Lefcourt, Lawyer and Brother|
|Free to download magazine dedicated to Commodore computers||Morning session I: Dedicated to Prof. A. Acrivos, “Suspensions and particulates”|
|08: 30 Registration 09: 00 Welcome Remarks Morning session I: Dedicated to Prof. A. Acrivos, “Suspensions and particulates”||The Culture of Irises in the United States Iris Culture for the Mountain and Plains Region, D. M. Andrews 5|