ごろにゃ~の手帳(備忘録)

備忘録的ブログ。経営やマネジメント、IT、資産運用、健康管理などについて書き留めてます。

技術的負債

「技術的負債」という表現は、WikiWikiの発明者で著名なプログラマとして知られるウォード・カニンガム氏が1992年に使ったのが原典とされています。

カニンガム氏が「技術的負債」という表現をはじめて使ったのは、1992年に行われたACM主催のイベント「OOPSLA '92 」(Object-Oriented Programming, Systems, Languages & Applications) だとされています。カニンガム氏のサイトで公開されている「The WyCash Portfolio Management System」から引用します。


Shipping first time code is like going into debt. A little debt speeds development so long as it is paid back promptly with a rewrite. Objects make the cost of this transaction tolerable. The danger occurs when the debt is not repaid. Every minute spent on not-quite-right code counts as interest on that debt. Entire engineering organizations can be brought to a stand-still under the debt load of an unconsolidated implementation, object- oriented or otherwise.
コードをはじめて出荷することは、借金をしに行くようなものだ。少しの借金なら、リライトによりそれを埋め合わせることを促し、開発を加速することになる。オブジェクト指向は、こうした作業を許容可能にしてくれる。
危険なのは、この借金が返されなかったときだ。その適切ではないコードのために費やされた時間はすべて、借金の利子にあたる。そして技術部門のエンジニアの誰もが、からまった実装による借金の重圧を前に立ち尽くすことになる。オブジェクト指向だろうがそうでなかろうがだ。

マーチン・ファウラー氏も2009年に「Technical Debt」という記事で、カニンガム氏の「技術的負債」という比喩について説明をしています。
In this metaphor, doing things the quick and dirty way sets us up with a technical debt, which is similar to a financial debt. Like a financial debt, the technical debt incurs interest payments, which come in the form of the extra effort that we have to do in future development because of the quick and dirty design choice. We can choose to continue paying the interest, or we can pay down the principal by refactoring the quick and dirty design into the better design. Although it costs to pay down the principal, we gain by reduced interest payments in the future.

(技術的負債という)比喩は、やっつけ作業によって発生するものが、お金の借金に似ているということだ。お金の借金と同じように、技術的負債も利子が発生する。それは、やっつけ作業を選択した結果として、追加作業のような形でいずれ表れることになる。
私たちはその利子を払い続けることもできるし、どこかできちんと良い設計でリファクタリングし直すことによって、借金の元本を返すこともできる。元本を返すのにはコストがかかるけれども、その後の利子を減らすという利益がある。
カニンガム氏もファウラー氏も、技術的負債を抱えることによって「からまった実装による借金の重圧を前に立ち尽くす」「追加作業のような形でいずれ表れることになる」と説明しています。
できの悪いソフトウェアを作ってしまうと、あとからデバッグリファクタリングなどの手間が大幅にかかるという指摘です。