From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,4b06f8f15f01a568 X-Google-Attributes: gid103376,public From: mfb@mbunix.mitre.org (Michael F Brenner) Subject: Re: Expressive Case Statements (was: Software landmines) Date: 1998/09/07 Message-ID: <6t0j8a$eci@top.mitre.org>#1/1 X-Deja-AN: 388672603 References: <35f51e53.48044143@ Organization: The MITRE Corporation, Bedford Mass. Newsgroups: comp.lang.ada Date: 1998-09-07T00:00:00+00:00 List-Id: > how does one correctly decide what is best to code as program logic > and what is best to code as data? The decision whether to code a particular portion of an algorithm as code or data within the software can be made using the same four criteria (i.e. metrics) used to determine whether to code an algorithm as software at all (versus reading in data at runtime). First, there is the total cost of maintenance. This is almost always made cheaper by using data rather than code, but analysis may occasionally find code easier to maintain, particularly if the data is nested more than the code would be. Second is distributed size of the system. The more parts the system has, the more expensive code becomes than data. For example, consider the Upper Slobbovian Command and Control System which tracks all civilian and military flights of airplanes, satellites, friendly missiles (those aimed away from you), and unfriendlies. Here a large expense is the fact that some things are classified. It is much cheaper to read in the classified data at runtime and keep the software unclassified. Third is to minimize the coupling. Coupling is the weighted sum of the globality of the references. Global references get a high weight; intermediate references get a low weight; purely local references get a low weight. Fourth is the controversial cohesion metric. While it does not compete with lifecycle maintenance cost, distributed size of system, or non-localization of reference, your selected cohesion metric will be your judgement of the localization of function, the relationship between inputs and outputs, the ease of computing the precondition from the postcondition, and the single-mindedness of the purpose. There is a method of measuring this objectively by interpreting the software as a braid in a particular braid group and using the cohesion of the braid as the measure of the cohesion of the software. Mike Brenner mikeb@mitre.org