Tuesday, February 22, 2011

Extreme Programming Ch 16-18 and Design of Future Things Ch 6

Extreme Programming
By: Ron Jeffries; Ann Anderson; Chet Hendrickson
Publisher: Addison-Wesley Professional
Pub. Date: October 16, 2000

Chapter 16 : Do or Do Not

lol
I'm sticking with the Star Wars themed pictures again this week:



Much like the title would suggest, this chapter lists a few do and do nots of the Extreme Programming methology.

Dos :
Well Designed Code
Well Crafted Code
Flexibly Structured Code
Properly Documented Code
Tested Code
Code that meets known and documented requirements
Design all the time
Do get comfortable taking on any story in any order
Do focus on communication
Do pay attention to your metrics and key reporting graphs
Do let everyone get involved in design
Do build cleanly for today

Donts :
Don't design the whole system before implementing
Don't try to freeze requirements before implementing
Don't produce voluminous design docs at the beginning
Don't produce docs or artifacts that aren't being used
Don't separate the team into designer and coders
Don't build for tomorrow x3 - do the simplest design first; it saves time. Improvements put in later will be easier and code stays simpler

Chapter 17 : Experience Improves Estimates

The author recommends that the extreme programmer should note how long it takes for them to accomplish a task minus the time it took to think and design.
Breaking down stories into small tasks helps with the estimation.
The author also recommends that the programmer should estimate each task that they sign up for and estimate in terms of hours, to observe the amount of time it took to implement versus the estimation, and to note why there was a difference. By noticing these things the programmer gets experience at story estimation.


Chapter 18 : Resources, Scope, Quality, Time

In this chapter, the author highlights the important metrics to keep track of during development and addresses which metrics and methods should be avoided. Key resources to track include: planned versus actual hours of work, number of developers and customers assigned to the project, number of computers and tests, etc...

For scope, the team should keep track of the stories over time and how that fluctuates over time for both achieved and yet to be achieved tasks.

For quality, the XP method endorses acceptance testing graphs with the number of tests and number succeded over time.

For time, XP recommends to track the results of each release plan to the schedule.

Overall the XP methodology urges teams to keep graphs as simple as possible and to know whether progress with respect to the number of stories is related to feature creep or whether the stories are being fulfilled at a good rate. The author notes that managers typically measure whether the project was accomplished by the release date, so her urges the reader to always deliver on time.

Finally, the chapter covers a few key graphs to use and emphasizes keeping track of the team's attitude and the surrounding atmosphere to gauge the success of the project and its tests. Usually a bad atmosphere and foul moods translate to bad code and lots of bugs.

The Design of Future Things

Design of Future Things
By: Donald Norman
Publisher: New York Basic Book
Pub. Date: November 2007

Chapter 6 : Communicating with our Machines

Expanding on previously introduced ideas of natural interaction, Norman extols the virtues of communication that is self-explaining and non-intrusive. Electronic equipment and computers tend to hide their state internally and only show the end result of their processing so that when errors occur, there is a lack of feedback that make the problems difficult to trace and largely their operation is not understood.

Norman claims that feedback is important for six reasons:
Reassurance
Progress Reports and Time Estimates
Learning
Special Circumstances
Confirmation
Governing Expectations

From there Norman makes the observation that successful products should provide an intelligible model for failure that allows the attribution of blame to fall on the user and not the machine.

Norman then introduces the idea of "calm technology" whereby communications and signaling continuously on the periphery of the users focus and only intrude when necessary allowing the user shift their focus, attend to the problem, and then allow the communication to slip back into the periphery.

Finally, Norman proposes that machine feedback should follow natural mappings for communication and already understood principles of design.
He lists six Rules:
Rule 1: Provide rich, complex, natural signals
Rule 2: Be predictable
Rule 3: Provide a rich conceptual model
Rule 4: Make the output understandable
Rule 5: Provide continual awareness, without annoyance.
Rule 6: Exploit natural mapping to make the interaction understandable

Discussion:

Extreme Programming:

A list of dos and donts is refreshingly concise and quite practical even if it does seem a bit tactless. I like the idea of not building for tomorrow in light of recent experiences. I was working on a game development project recently and I kept finding that my teammate kept expanding the scope of the project and increasing the complexity of the code unnecessarily while I was trying to keep develop as quickly and as simply as possible. We both had high expectations for the game and want to expand the game beyond the initial turnin for the class, but as it stood, the increased complexity of his codes and expectations was slowing the development and introducing bugs in the code. Most of his ideas could have been easily picked up and expanded on, but his expectations were rather inflexible which made things hard.
Anyways, keeping things simple and in the present is nice.

The chapter on experience improving estimates was stating the obvious, but its best to be thorough, I suppose.

The chapter on project metrics kept things simple, as usual, which I like to see. I agree with most of his assertions mainly because they help keep the project's progress to being driven requirements and man hours which makes more sense than the project being driven by documentation. I really like the fact that XP emphasizes working with people and noticing their frustrations or lack thereof. I'm sure that red flags are raised in people's attitudes and dispositions long before those flags are found in the code. Having things being people oriented is nice tech world where there's a tendency to focus on cold facts and the gears of systems and industry.

Design of Future Things:

Normans experiences and observations on successful products and consequences of blame and particularly insightful. Put simply, if the computer makes a mistake, it should be a reasonable mistake by the users understood model of "how it works" rather than a mistake made by the "dumb computer." If it's a reasonable mistake, then the user can compensate. Else there's just frustration.
Tech companies marketing their products to the public should take note of that.

The idea of "calm technology" is a nice treatise that addresses concern Norman had in the previous Chapter. "Calm Technology" allows for automation in intelligent technologies that allows for automation to proceed smoothly until it's needs to be attended to by the user or attendant. The user can focus on a present task meanwhile the intelligent machine simply hangs on the periphery of the users attention only to intrude without annoyance when difficulties arise rather than handling controls and operation only to intrude on a non-participating operator that isn't already focused on the operation and is thus likely to fail.

The section on natural communication design and mappings is probably a little too obvious to be written down in the book and the subject was handled much better in "The Design of Everyday Things."

Monday, February 14, 2011

Extreme Programming Ch 13-15 and Design of Future Things Ch 5

Extreme Programming
By: Ron Jeffries; Ann Anderson; Chet Hendrickson
Publisher: Addison-Wesley Professional
Pub. Date: October 16, 2000

Chapter 13 : Unit Tests

A major component of XP methodology is unit testing. XP claims that tests are needed for every class and for everything that could possibly break as prescribed by the programming pair's judgment. Furthermore, tests integrated must test out at 100% for every run. The author mentions that unit testing brings the benefits of reassurance and confidence for the programmer as well as making the development process both more complete and more correct simultaneously thereby reducing the chances of regression with the submission of new code. Another subpoint made was that the test methods name should have a connection to the code it tests.
The chapter also lists a summary of the testing steps in XP:

1) Create a test class.
2) Code a setup method to create a "scrutinizer" object.
3) Write a test.
4) Run the test.
5) Modify the model code and repeat 4-5 until the test runs successfully.
6) Release the model code and the test case. (The test cases are a permanent part of the software in XP)

The chapter ends by answering a few frequently asked questions where it was emphasized that unit testing should be quick, within reason, and simple.
Test stubs are encouraged for database related software.
Separation of processing code and GUI code is also encouraged.

Chapter 14 : Test First, by Intention

This chapter was a running example in smalltalk where a programming pair wrote some code from scratch with unit tests made alongside it. The point of the chapter was to show to code by intention rather than by lower level implementation.
Coding by intention is meant to make the code and the understanding of the code clearer by expressing what you want rather than how to get it.

Chapter 15 : Releasing Changes

Since XP tenets ascribe to collective code ownership and frequent submissions, managing release changes is addressed in this chapter. First, the author mentions that code evolves through three phases:
1) Local - Begin work
2) Release Candidate - Task finished
3) Released to Repository - 100% of tests work

To make sure that code across all teams are synchronized and development proceeds smoothly, the programming pair should use this release process:
1) Always start with all the released code.
2) Write tests that correspond to your task.
3) Run all the unit tests.
4) Fix any unit tests that are broken.
5) When all the unit tests run at 100%, make the local changes become release candidates.
6) Release candidate changes with the released code on a separate integration machine and reload the released code and check for conflicting edits.
7) Identify changes made by other programming pairs and integrate those changes with yours.
8) Run the tests on the integrated machine and get them to run at 100%
9) Release the code on the integration machine as the official version.

XP also advocates the use of code management tools to do the following:
1) Identify local changes
2) Differentiate between local changes and released code.
3) Identify who released a change, and when they released it.
4) Merge changes and the released code.
5) Revert to previously released code.

The author warns the reader to avoid trying to work on different parts of the coding project and says to just let the code's needs dictate code assignments and changes primarily because the author claims that this will slow development.

To avoid lost changes, XP recommends that to always start with all the released code and always release changes frequently. The author also mentions that unit tests that are part of the system will usually identify portions of missing code that were lost.
XP makes a final recommendation of backing up source code early and often.



The Design of Future Things

Design of Future Things
By: Donald Norman
Publisher: New York Basic Book
Pub. Date: November 2007

Chapter 5 : The Role of Automation

In this chapter,

Norman cites several needs or reasons for automation: To eliminate the dull, the dangerous, and the dirty; to simplify complex tasks, to reduce the work force, to entertain, to shift the time that the work must be done, or "just because it can be done."
Norman also cites a few examples of automation in autonomous systems and discusses their drawbacks and benefits; namely, that autonomous intelligent machines tend only to work well in well defined environments and task problems where the domain is thoroughly understood and observable. Another major drawback is that autonomous automation is unable to infer the intentions of the users or the actual state of the environment and may act incorrectly. These incorrect actions can potentially be quite pernicious and are at best, annoying, despite the availability of training or learning correction algorithms. Automation in intelligent or adaptive systems can even have the effect of training their user as much as the user can train their system. For example, the owner of the smart home found himself coming home from work earlier than usual since the home was heating up the house in preparation for his arrival.

From there, Norman introduces the reader to the alternative of intelligent machines that are designed to augment current trends and complement human behavioral patterns.
Augmentative intelligent technologies have the benefit of not being intrusive and their being entirely voluntary. Norman fails to list the drawbacks of the augmentative systems.

Discussion:

Extreme Programming:

Testing is an indispensable process for any software development process and I think XP hits the nail on the head with its recommendations, although I myself am likely to ignore their suggestions in practice mostly because most tests when written during development feel like a waste of time because they're so obvious.
Putting aside my reservations, the frequent testing I know has been proven to reduce both the time spent on a project and to improve it's quality especially in terms of the bugs reduction.

The chapter on coding by intention was wasted time and effort on their part, I think. The example was weak and their goal was relatively vague.

XPs submission and integration sounds quite thorough and probably pays in spades on large projects with many different teams. XP recommendations on specific unit testing tools was out of place given that their book is to inform on methodology rather than on technology.

Their adherence to frequent unit testing at 100 percent is very powerful in that makes the software resilient from regressive submissions to the final code and XPs recommendation to make the tests a permanent part of the system is particularly interesting from an integration testing standpoint. I'm sure that XP developed code is a joy to revisit given the presence of those tests.

Design of Future Things:

Given the array of problems that Norman has discussed in autonomous agents and his lack of criticism for augmented intelligent agents, that he much prefers less intrusive technologies, and to an extent, I'm inclined to agree.

There is a tendency with technology enthusiasts to promote autonomous intelligence and an assumption that such intelligence is naturally being more "helpful." While autonomous agents are potentially much more powerful than mere augmented intelligence, they are much less likely to cause cognitive friction with the users which is an invaluable property of good technology. After all, technology is designed to solve problems and reduce strain, psychologically or physiologically, for the users of the technology. Autonomous technology, however, tends to insert its own will or ideas into the user's awareness which can potentially be disruptive. Meanwhile augmented technology is like a good waiter: not to be seen or heard, but still serving your needs when you will it.

We already have enough conflict of will with other people and introducing computational will onto the scene won't promote peaceful society, in my mind.

Monday, February 7, 2011

Extreme Programming Ch 10-12 and Design of Future Things Ch 4

Extreme Programming
By: Ron Jeffries; Ann Anderson; Chet Hendrickson
Publisher: Addison-Wesley Professional
Pub. Date: October 16, 2000

Chapter 10 : Quick Design Session

XP declares that after a story is broken down into tasks and there's still questions held by the programmers, the team should sketch out a design, discuss code structure and objects, and listen to ideas. This process should only take 30 minutes at the most.

Chapter 11 : Programming

The actual programming portion of the XP coding mantra advocates:

1) testing often - Testing often reduces bugs since bugs don't build up in number before they're fixed, there's fewer dependencies, and programmers are more familiar with the code at test time.

2) pair programming - Next Chapter

3) collective code ownership - allows programmers to improve all code when encountered which increases readability and reliability

4) simple design - code with a simple design is easy to modify, is readable, and tends to be efficient. A simple design consists of four properties that lend to quality code:
a) Runs all the tests
b) Expresses every idea you need to express
c) Contains no duplicate code
d) Has the minimum number of classes and methods

5) refactoring - refactoring is the tool used to keep the code within the simple design ideal and reduces bugs.

6) continuous integration - Since integration causes bugs to appear through the interaction of multiple components and bugs are best found early, integration is done continuously; or in other words, several times a day. In line with continuous integration is the idea of keeping build times low enough so that continuous integration can be done.

7) developing a coding standard and conventions - Since code is collectively owned and refactoring should be done on all code, it's important that the code is understandable and readable for the entire team. As such, common coding conventions and coding style should be enforced. Some issues for standardization include:
a) Indentation
b) Capitalization
c) Commenting
d) Method Size
e) Names

8) limiting overtime work - Rushing to meet deadlines produces bad buggy code. Therefore, it overtime work should be limited and scheduling done accurately.

Chapter 12 : Pair Programming

Pair programming is where two programmers code together and where one acts as a "driver" and the other programmer acts as the "partner."

The driver does the programming while explaining what he's doing and what he's thinking making sure that the partner is engaged.

Meanwhile the partner is actively engaged watching for syntax errors, making sure the driver adheres to the team's coding style, and keeping an eye out for mistakes, pitfalls, or confusing code that the driver might make.

Pair programming allows the driver to focus on the code and lower level issues while the partner can focus on higher level issues. This separation of concerns allows for complementing ideas to enter in simultaneously and results in clearer quality code.

The Design of Future Things

Design of Future Things
By: Donald Norman
Publisher: New York Basic Book
Pub. Date: November 2007

Chapter 4 : Servants of our Machines

Norman begins this chapter by relating a fabricated story where a Mr. Newone got stuck in a traffic loop in his car. With this story, he makes the point that with automation comes unforeseen errors and complications in even well engineered intelligences. From there, Norman explores the relationship between technology and human activity from a historical perspective. Norman claims that there's been a fundamental shift in the understanding of technology and the way in which technology interacts with the user of the technological tool; primarily, he claims that automation technology is not fully automated and requires human vigilance and insertion of control in dangerous or unexpected contingencies in the control loop.
This mode of interaction does not compliment human strengths of tendencies and Norman argues that technology should be either fully automated or not at all.
Norman also claims that automation is reducing human understanding and awareness, but more importantly that new technologies introduce unexpected outcomes, both good and bad. Finally, Norman discusses the platooning and swarming technology as it relates to automobiles.





Discussion:

Extreme Programming:

Finally, XP comes to the actual programming section and makes its "extreme recommendations." Like I've said earlier, I like the idea of pair programming and I've had positive experiences with it in the past. Pair programming, is like they say, fun and a lot of bad ideas and bugs do get caught while doing it.

As much as XP likes it, I don't care much for the idea of "continuous integration." It just doesn't seem all that possible to me, especially for large projects where build time can take a day or longer. Now integrating once a day seems reasonable though.

I could stand to improve my own coding style by adhering to their simple design principles and should definitely refactor my own code more often. So I guess I'll take this as "lesson learned."

Overall, I wouldn't say that Extreme Programming is all that extreme. Really they're only advocating good coding principles.

Design of Future Things:

While interesting overall, I feel that Norman diverged from the title of his chapter "Servants of Our Machines" and rambled a good bit.

His observations on human tendencies once again prove to be the most valuable. His observations on vigilance on systems that are mostly automated raise interesting questions for transportation automation and almost imply that full automation of any kind of transportation is unfeasible due to the unexpected nature of reality, administration implications, and issues of adoption rates, despite what benefits automation in those fields could provide.

It was interesting to see that Norman essentially chose a view of technology that matched the orientation that was advocated in the Ethics of Engineering course I took last semester; namely that Technology should neither be viewed pessimistically or optimistically, but with a mixed view that acknowledges that technologies both solve and introduce new problems and that the progression of technology will continue despite lack of understanding of the resulting effects.

Wednesday, February 2, 2011

Extreme Programming Ch 7-9 and Design of Future Things Ch 3

Extreme Programming
By: Ron Jeffries; Ann Anderson; Chet Hendrickson
Publisher: Addison-Wesley Professional
Pub. Date: October 16, 2000

Chapter 7 : Small Releases
This chapter emphasizes the importance of small releases and releasing small
bits that add value. The XP programming methodology claims that these small
releases will keep the programming team confident and productive and gives the
customer feedback and the ability to evaluate.

After explaining their reasons for emphasizing small releases, the book goes
into a few examples of how to split up "all or nothing" kinds of software projects.
Examples included:
1) Payroll System - replace parts of the legacy system one by one, do GUI first...
2) Personnel System - give users better way to input, web interfaces, make new database compatible with the legacy system
3) Tax Package - Start with GUI, replace individual form calculation incrementally with new engine.
4) Distributed Manufacturing Control System - control individual machines in the first, eventually make way to the centralized control.
5) Air Traffic Control System - Distributed Communication and Control (plane to plane)

Chapter 8 : Customer Defines Release



In this chapter, the book explains that the Customer defines what the product is and what is released in an individual iteration. Primarily, the customer writes the stories in a session that constitutes the exploration part of the XP methodology. As the customer writes the stories, the programmers ask questions and the customer answers or asks for clarification. Ambiguity should be avoided at any cost. The programmers will then estimate the time to implement each feature of each story and figure out a velocity for the iterations. Once the iterations are defined a tentative schedule can be made.
The basic steps of the release plan
1. Write enough stories to define a successful product.
2. Do any necessary exploration.
3. Estimate the difficulty of implementing each story. (Story Estimation)
4. Estimate the speed of story implementation.
5. Choose stories for the first release based on business value and difficulty.

Chapter 9 : Iteration Planning

Since the XP methodology prescribes working on small iterations, correct estimation and planning for the iterations is critical and any estimations need to be realistic rather than based on "best intentions."

The three main steps of Iteration Planning:

1. The customer presents user stories - The exploration phase of the iteration planning. The customer explains each story. Understanding of what's needed is important.

2. The team brainstorms engineering tasks - East feature of each story corresponds to different engineering challenges that should be accounted for. If the programmers can't accurately estimate a story based on past experience a spike solution should be made within a day or two.

3. The programmer signs up for and estimates the work - Individual programmers volunteers for different tasks on the story based on what they think they can accomplish. It's preferable that a programmer should be responsible for a story but splitting the story to different programmers is acceptable if expertise on certain engineering issues forces the assignment. Programmers are obligated to help others if they ask for it.

The Design of Future Things

Design of Future Things
By: Donald Norman
Publisher: New York Basic Book
Pub. Date: November 2007

Chapter 3 : Natural Interaction

In this chapter, Norman discusses how to get Machines to communicate naturally without signaling obtrusively or annoyingly. First, Norman explores the idea that audio communication should reveal the nature of the material or action that the machine made or doing, respectively. Norman provides an example of the common teapot where the boiling of the water is used to produce a signal that conveys the degree of readiness of the water inside. Norman also points out that a wide range of communication can be implicitly provided by affordances built into the design of the machine itself. By providing affordances in design, designers can inform the user the range of actions and states the machine has without explicitly saying so. He also mentions of the danger of removing naturally occurring "noise" because it reduces the level of implicit feedback to the user.

Norman also discusses a means of introducing implicit feedback by design by visiting the "tight-rein / loose-reign" manipulation schemes originally found in horseback riding. In other words, he proposes that machines should switch allow for smooth transitions between machine autonomy versus user control.

Finally, Norman discusses the phenomenon and implications of Risk Homeostasis where it has been found that the safety provided by safer designs and technologies is counteracted by increased risk taking activity in human actions. He makes the implication that we should design to make inherent dangers apparent to those exposed to them to promote safer behavior.


Discussion:

Extreme Programming:
I really felt that we were re-hashing ideas already introduced, so I don't have much to say about those. I will say, however, that the rule of always helping programmers that ask for help is appealing to me. Programmers should always be part of a team. The field of computer science and the array of technologies is both deep and wide and the need the supplement our learning experiences and expertise to our peers is necessary to produce great software that we can all be proud of. Furthermore the requirement to always help team members would naturally increase teamwork and thus overall workplace harmony, which is important seeing as how we spend most of our life working.

Design of Future Things:
I feel that implicit and natural feedback is a great topic for exploration in design is great. Decreasing the annoyances while improving feedback is certainly a topic that deserves exploration given the array of digital devices in common use today.

By providing "loose-reign / tight-reign" transition methodologies by design, the interaction scheme could vary by situation where user control is inserted where needed while the machine can in other situations with minimal user input. I think this would increase the degree of symbiosis described in previous chapters and it sounds like a great idea, provided the mode switching is seemless and loss of control is non-obtrusive.

As far as implementing to make dangers more apparent is concerned, I stand almost entirely opposed. Increasing perceived risk would cause undue mental fatigue and stress on potentially (most likely) non-consenting populations. Even if the overall design of the system results in increased safety, we increase psychological harm, overall frustration, and a perceived loss in societal progress that drives future innovation in design. It's just not worth it.