Monday, December 19, 2005

 

Stuff that lets agile software developers show off what they believe in

"Born To Refactor":
In software engineering, the term refactoring means modifying source code without changing its external behavior, and is sometimes informally referred to as "cleaning it up". In extreme programming and other agile methodologies refactoring is an integral part of the software development cycle: developers alternate between adding new tests and functionality and refactoring the code to improve its internal consistency and clarity. Automated unit Testing ensures that refactoring does not make the code stop working.
Refactoring does not fix bugs or add new functionality. Rather it is designed to improve the understandability of the code or change its structure and design, and remove dead code, to make it easier for human maintenance in the future. In particular, adding new behavior to a program might be difficult with the program's given structure, so a developer might refactor it first to make it easy, and then add the new behavior.
An example of a trivial refactoring is to change a variable name into something more meaningful, such as from a single letter 'i' to 'interestRate'. A more complex refactoring is to turn the code within an if block into a subroutine. An even more complex refactoring is to replace an if conditional with polymorphism. While "cleaning up" code has happened for decades, the key insight in refactoring is to intentionally "clean up" code separately from adding new functionality, using a known catalogue of common useful refactoring methods, and then separately testing the code (knowing that any behavioral changes indicate a bug). The new aspect is explicitly wanting to improve an existing design without altering its intent or behavior.
The term is by analogy with the factorization of numbers and polynomials. For example, x2 − 1 can be factored as (x + 1)(x – 1), revealing an internal structure that was previously not visible (such as the two roots at +1 and –1). Similarly, in software refactoring, the change in visible structure can often reveal the "hidden" internal structure of the original code.
Refactoring is done as a separate step, to simplify testing. At the end of the refactoring, any change in behavior is clearly a bug and can be fixed separately from the problem of debugging the new behavior.
Martin Fowler's book Refactoring is the classic reference. Although refactoring code has been done informally for years, William F. Opdyke's 1993 PhD dissertation [1] is the first known paper to specifically examine refactoring. All of these resources provide a catalog of common methods for refactoring; a refactoring method has a description of how to apply the method and indicators for when you should (or should not) apply the method.
Refactoring is such an important concept that it has been identified as one of the most important software innovations by author and commentator David A. Wheeler.

source: http://en.wikipedia.org/wiki/Refactor

"JsUnit":
JsUnit is a Unit Testing framework for client-side (in-browser) JavaScript. It is essentially a port of JUnit to JavaScript. Also included is a platform for automating the execution of tests on multiple browsers and mutiple machines running different OSs. Its development began in January 2001.

source: http://www.edwardh.com/jsunit/

This page is powered by Blogger. Isn't yours?