Ubiquitous Automation Civilization Advances by Extending the Number of Important Operations We Can Perform Without Thinking

Ubiquitous Automation Civilization Advances by Extending the Number of Important Operations We Can Perform Without Thinking

software construction Editors: Andy Hunt and Dave Thomas I The Pragmatic Programmers [email protected] I [email protected] Ubiquitous Automation Civilization advances by extending the number of important operations we can perform without thinking. —Alfred North Whitehead Welcome to our new column on software Many authors and pundits have compelling argu- construction. We hope that you’ll enjoy follow- ments for each of these viewpoints.1–3 This is un- ing this series as we explore the practical nuts- derstandable because all the views have merit— and-bolts issues of building today’s software. software development is all these things, and this Before we start, though, we need to talk about plurality is what causes so much misunderstand- the column’s title. In some ways, “construction” is ing. When should we act like engineers, and an unfortunate term, in that the most immediate when shouldn’t we? (and often used) example involves building con- Many organizations still view coding as merely struction, with the attendant idea of an initial and a mechanical activity. They take the position that inviolate architecture from which springs forth de- design and architecture are of paramount impor- sign and code. tance and that coding should be a rigorous, re- peatable, mechanistic process that can be rele- gated to inexpensive, inexperienced novices. We wish these organizations the best of luck. We’d like to think we know a better way. The SWEBOK (Software Engineering Body of Knowl- edge—view an online draft at www.swebok.org), for instance, states unequivocally that coding is far from a mechanistic translation of good design into code, but instead is one of those messy, im- precise human activities that requires creativity, in- sight, and good communication skills. Good soft- ware is grown organically and evolves; it is not Of course, nothing could be further from the built slavishly and rigidly. Design and coding must truth. Software development, including its con- be flexible. We should not unduly constrain it in a struction, is utterly unlike any other human en- misguided attempt to turn coders into robots. deavor. (Software development is also exactly the However, the way we construct software same as all other human endeavors, but that’s a should not be arbitrary. It must be perfectly con- topic for another time.) Software is unique in both sistent, reliable, and repeatable, time after time. its malleability and its ephemerality; it is (to bor- And that’s the topic of this first column. row the title of a Thomas Disch book) the dreams —Andy Hunt and Dave Thomas our stuff is made of. Yet we cannot simply wish a software system into being. We must create it us- ing some semblance of engineering practice. This tension between the nonrepeatable, ill-defined, References 1. P. McBreen, Software Craftsmanship: The New Impera- chaotic creative process and the scientific, repeat- tive, Addison-Wesley, Reading, Mass., 2001. able, well-defined aspects of engineering is what 2. T. Bollinger, “The Interplay of Art and Science in Soft- causes so much heartburn in practitioners, au- ware,” Computer, vol. 30, no. 10, Oct. 1997, pp. 128, 125–126. thors, and scholars. 3. W. Humphrey, Managing the Software Process, Addi- Is software engineering? Is it art? Is it craft? son-Wesley, Reading, Mass., 1989. 0740-7459/02/$17.00 © 2002 IEEE January/February 2002 IEEE SOFTWARE 11 SOFTWAREDEPT CONSTRUCTION TITLE f software construction is to in- that every developer on a project com- tests to try to find holes in our soft- volve engineering, the process piles his or her software the same way, ware. (There are many other, equally must be consistent and repeat- using the same tools, against the same important, reasons for using unit able. Without consistency, know- set of dependencies. Make sure this tests, but that’s the subject of another ing how to build, test, or ship compilation process is automated. article.) However, most developers I someone else’s software (or even This advice might seem obvious, we’ve seen skip unit testing or at best your own software two years later) is but it’s surprising how often it’s ig- do it in an ad hoc way. The standard hard, if not impossible. Without re- nored. We know teams where some technique goes something like this: peatability, how can you guarantee developers compile using the auto- the results of a build or a test run— matic dependencies calculated by 1. Write a wad of code. how do you know the 100,000 CDs their integrated development environ- 2. Get scared enough about some as- you just burned contain the same ment, others use a second IDE, and pect of it to feel the need to try it. software you think you just tested? still others use command-line build 3. Write some kind of driver that in- The simple answer is discipline: tools. The result? Hours wasted every vokes the code just written. Add a software construction must be disci- week tracking down problems that few print statements to the code plined if it is to succeed. But people aren’t really problems, as each devel- under test to verify it’s doing what don’t seem to come that way; in gen- oper tests against subtly different ex- you thought it should. eral, folks find discipline hard to take ecutables generated by his or her in- 4. Run the test, eyeball the output, and even harder to maintain. Fortu- dividual compilation system. and then delete (or comment out) nately, there’s a pragmatic solution: Nowadays, automated compila- the prints. automate everything you can, so that tions are pretty straightforward. Most 5. Go back to Step 1. the development environment itself IDEs offer a single-key “compile the provides the disciplined consistency project” command. If you’re using Let us be clear. This is not unit test- and repeatability needed to make the Java from the command line, there’s ing. This is appeasing the gods. Why process run smoothly and reliably. the Ant tool (http://jakarta.apache.org/ invest in building tests only to throw This approach leaves developers free ant/index.html). In other environ- them away after you’ve run them to work on the more creative (and ments, the “make” system, or less once? And why rely on simply scan- fun) side of software construction, common variants such as Aegis (www. ning the results when you can have which makes the programmers hap- pcug.org.au/~millerp/aegis/aegis.html), the computer check them for you? pier. At the same time, it makes the do the same job. Whatever the tool, Fortunately, easy-to-use automated accountants happier by creating a de- the ground rules are the same: provide testing frameworks are available for velopment organization that is more a single command that works out most common programming lan- efficient and less prone to costly hu- what needs to be done, does it, and re- guages. A popular choice is the set of man-induced errors and omissions. ports any errors encountered. xUnit frameworks, based on the Gamma/Beck JUnit and SUnit systems Compilation automation Testing automation (www.xprogramming.com/software. If you do nothing else, make sure During construction, we use unit htm). We’ll look at these frameworks Career Opportunities PURDUE UNIVERSITY compilers, databases, distributed and research. Salary and benefits are highly Department of Computer Sciences parallel computing, geometric modeling competitive. Special departmental and and scientific visualization, graphics, in- university initiatives are available for ju- The Department of Computer Sciences formation security, networking and oper- nior faculty. Candidates should send a at Purdue University invites applications ating systems, programming languages, curriculum vitae, a statement of career for tenure-track positions beginning Au- scientific computing, and software engi- objectives, and names and contact infor- gust 2002. Positions are available at the neering. The department implements a mation of at least three references to: assistant professor level; senior positions strategic plan for future growth which is Chair, Faculty Search Committee will be considered for highly qualified ap- strongly supported by the higher admin- Department of Computer Sciences plicants. Applications from outstanding istration. This plan includes a new build- Purdue University candidates in all areas of computer sci- ing expected to be operational in 2004 to West Lafayette, IN 47907-1398 ence will be considered. Areas of particu- accommodate the significant growth in Applications are being accepted now lar interest include security, networking faculty size. Further information about and will be considered until the positions and distributed systems, scientific com- the department is available at are filled. Inquiries may be sent to puting, and software engineering. http://www.cs.purdue.edu. [email protected]. The Department of Computer Sciences Applicants should hold a Ph.D. in Purdue University is an Equal Opportu- offers a stimulating and nurturing acade- Computer Science, or a closely related nity/Affirmative Action mic environment. Thirty-five faculty discipline, and should be committed to employer. Women and minorities are es- members have research programs in excellence in teaching and have demon- pecially encouraged to apply. analysis of algorithms, bioinformatics, strated strong potential for excellence in 12 IEEE SOFTWARE January/February 2002 SOFTWAREDEPT CONSTRUCTION TITLE in later articles. For now, it’s enough it work when it gets there? Think have no shoes. Often, people who de- to point out that they are simple to about how much of this process you velop software use the poorest tools use, composable (so you can build can automate, allowing the quality to do the job. You can do better than suites of tests), and fully automated.

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    3 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us