<?xml-model href='http://www.tei-c.org/release/xml/tei/custom/schema/relaxng/tei_all.rng' schematypens='http://relaxng.org/ns/structure/1.0'?><TEI xmlns="http://www.tei-c.org/ns/1.0">
	<teiHeader>
		<fileDesc>
			<titleStmt><title level='a'>A Survey of Tool Support for Working with Design Decisions in Code</title></titleStmt>
			<publicationStmt>
				<publisher>ACM</publisher>
				<date>02/29/2024</date>
			</publicationStmt>
			<sourceDesc>
				<bibl> 
					<idno type="par_id">10490780</idno>
					<idno type="doi">10.1145/3607868</idno>
					<title level='j'>ACM Computing Surveys</title>
<idno>0360-0300</idno>
<biblScope unit="volume">56</biblScope>
<biblScope unit="issue">2</biblScope>					

					<author>Sahar Mehrpour</author><author>Thomas D. Latoza</author>
				</bibl>
			</sourceDesc>
		</fileDesc>
		<profileDesc>
			<abstract><ab><![CDATA[Whenever developers choose among alternative technical approaches, they make a design decision. Collectively, design decisions shape how software implements its requirements and shape non-functional quality attributes such as maintainability, extensibility, and performance. Developers work with design decisions both when identifying, choosing, and documenting alternatives and when later work requires following and understanding previously made design decisions. Design decisions encompass design rationale, describing the alternatives and justification for a design choice, as well as design rules, describing the constraints imposed by specific alternatives. This article summarizes and classifies research on these activities, examining different approaches through which tools may support developers in working with design decisions in code. We focus both on the technical aspects of tools as well as the human aspects of how tools support developers. Our survey identifies goals developers have in working with design decisions throughout the lifecycle of design decisions. We also examine the potential support tools may offer developers in achieving these goals and the challenges in offering better support.]]></ab></abstract>
		</profileDesc>
	</teiHeader>
	<text><body xmlns="http://www.tei-c.org/ns/1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xlink="http://www.w3.org/1999/xlink">
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="1">INTRODUCTION</head><p>When building software, developers work with design decisions every day. For example, a developer might employ the Proxy pattern <ref type="bibr">[59]</ref> in a document editor to reduce the cost of expensive object creations by providing a placeholder for the objects and only creating them on-demand. Or a developer might decide that, to reduce latency, map data will be lazily loaded and only transferred when needed. Or a developer might decide that, to make it easier to potentially change the library used for persistence, all interactions with the persistence framework will be localized in a specific module.</p><p>Design decisions describe a choice and the potential alternatives for a specific design problem <ref type="bibr">[147]</ref>. They describe how the system commits to a particular design and how the design space is restricted <ref type="bibr">[49]</ref>. They shape how software achieves its requirements, impacting the behavior of a program. At the same time, design decisions shape how software achieves a wide range of nonfunctional requirements, such as maintainability, extensibility, and performance.</p><p>Developers work with design decisions to accomplish specific goals, both when initially choosing between alternatives to make a design decision as well as when returning to a previously made decision to understand how to follow it. For example, a developer may have a goal to understand the rationale behind a design decision and the reasons for choosing one alternative instead of others. Accomplishing this goal can help to build a correct mental model of a codebase and to ensure that future changes and decision-making follow the intended design. A developer might also have a goal to write code that follows an existing design decision. In this case, the developer needs a clear and concise understanding of the design decision, the constraints it imposes, and how code elsewhere is implemented consistent with these constraints.</p><p>To work with design decisions, developers are traditionally encouraged to use design documents, which are intended to contain information on important design decisions. However, in practice today, developers work with design documents that are rarely updated, leaving them outdated, incomplete, and untrustworthy <ref type="bibr">[92]</ref>. Even when updated, it can be hard to follow design decisions <ref type="bibr">[104]</ref>. As design documents become distrusted or abandoned, developers may manually reverse-engineer design decisions and their rationale from code <ref type="bibr">[84]</ref>, which is often challenging. Questions about design rationale are some of the most frequently reported hard-to-answer questions <ref type="bibr">[83]</ref> and create one of the most serious problems developers report facing <ref type="bibr">[84]</ref>.</p><p>The difficulties developers experience in working with design decisions may have profound consequences on software projects, leading to code decay, architectural erosion, and defects <ref type="bibr">[48,</ref><ref type="bibr">95]</ref>. Incorrect, unfit, or ignored design decisions alter code's behavior, result in the code diverging from developers' own mental models of it, decrease code comprehensibility, and cause code decay. Difficulties may lead the implementation of the program to diverge from the original design (architectural drift) and for new design decisions to violate the intended architecture (software erosion) <ref type="bibr">[60,</ref><ref type="bibr">61,</ref><ref type="bibr">146,</ref><ref type="bibr">155]</ref>.</p><p>To address developers' difficulties, researchers have proposed a variety of tools that offer developers better support for accomplishing their goals in tasks in which they work with design decisions. Documentation tools enable developers to make design decisions explicit by documenting them in structured formats. Static analysis and system architecture tools enable developers to check documented design decisions against code. Design rationale tools capture, organize, and maintain design rationale and the process of decision-making. Design pattern catalog tools link code to existing documentation. Reverse engineering tools and software query languages enable developers to find unwritten design decisions by extracting frequent code snippets or to test hypothesized design decisions against code.</p><p>Given the vital role of software tools in facilitating developers' work, it is imperative to investigate their usage in practice and identify areas for improvement to better support developers' needs. Previous surveys have primarily focused on the technical performance of tools, such as their features and precision. Surveys have examined tools and techniques for detecting patterns in code, such as code clones <ref type="bibr">[126,</ref><ref type="bibr">134]</ref> and design patterns <ref type="bibr">[6,</ref><ref type="bibr">45]</ref>, and static analysis <ref type="bibr">[91]</ref> and design rationale tools <ref type="bibr">[122]</ref>. However, it is equally important to understand tools from the developers' perspective to assess if and when current tools may address the real needs of developers when working with design decisions and motivate the design of future more effective tools <ref type="bibr">[109]</ref>.</p><p>In this survey, we address these gaps by taking a developer-centered approach where we examine the goals developers have when working with design decisions and how tools may meet A Survey of Tool Support for Working with Design Decisions in Code 37:3 these needs. Specifically, we answer questions such as: What are the primary goals of developers when working with design decisions? Do existing tools meet these goals, and if not, how can they be modified to better support developers? Can existing tools be used to fulfill multiple goals?</p><p>This survey makes three contributions. First, we offer a taxonomy of tools that assist developers in working with design decisions. Second, we provide a list of goals that developers aim to accomplish, reflecting the needs developers have in working with design decisions. Third, we provide an evaluation of the level of support offered by each of these types of developer tools in helping developers to achieve these goals.</p><p>The structure of this survey is as follows: We first overview the background and related work on developer goals and software tools for working with design decisions (Section 2). Next, we describe the process and the methodology we followed to create this survey (Section 3). We define design decisions, including their constituent parts, various forms, and related concepts (Section 4). We then present a taxonomy of tools for working with design decisions and review tools of each type (Section 5). We identify six goals developers have when working with design decisions (Section 6) and critically examine the support offered by tools in helping developers achieve each of these goals (Section 7). We conclude with a discussion of new directions where tools may offer more effective support to developers in their work with design decisions in code (Sections 8 and 9).</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="2">RELATED WORK</head><p>Design decisions play a crucial role software development. A variety of tools have been designed to help developers work with design decisions, which we survey in this article. Other work has examined how developers work with design decisions in their everyday work with programming and identified challenges with using tools to work with design decisions. This survey also reviews this work, using it to identify goals developers have when working with design decisions as well as critically examine how effectively each type of tool may support achieving these goals.</p><p>Prior survey articles have reviewed many of the tools we examine in this article. One survey examined techniques used to document design decisions and identified reasons why these documentation methods are not commonly adopted in practice <ref type="bibr">[8]</ref>. Another surveyed the tools and techniques that have been designed for managing design rationale <ref type="bibr">[122]</ref>. Work has also examined the use of program analysis tools for software maintenance that are available and can be used by practitioners <ref type="bibr">[91]</ref>. Other surveys have classified tools and techniques for mining codebases to detect code clones <ref type="bibr">[126,</ref><ref type="bibr">134]</ref>, code patterns <ref type="bibr">[10]</ref>, and design patterns <ref type="bibr">[6,</ref><ref type="bibr">45]</ref>. In addition to these, this article also surveys design pattern catalog tools, system architecture tools, and software query languages and tools, for which we are aware of no prior surveys.</p><p>Building on these surveys, this survey differs by going beyond a technical perspective of the techniques used to also examine tools from the point of view of a developer working with design decisions. We identify developer goals in working with design decisions and critically examine the support tools may offer in helping developers achieve these goals.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="3">SURVEY METHODOLOGY</head><p>To create this article, we considered principles from well-known literature review methodologies <ref type="bibr">[76]</ref>. This section provides an overview of the methodology used for conducting this survey.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="3.1">Research Goals and Questions</head><p>The goals of this survey are to investigate the types of tools available for developers to support their work with design decisions, understand the goals that developers have when working with design decisions, and identify how accomplishing these goals can be supported by various types of tools.</p><p>Additionally, this survey aims to identify limitations in existing tools and explore opportunities for improvement or to introduce new tools that can better support developers. With these objectives in mind, we aim to address the following research questions:</p><p>RQ1. What types of tools are available to support developers working with design decisions? RQ2. What are developers' goals when they work with design decisions? RQ3. In what ways do tools support developers in accomplishing their goals working with design decisions?</p><p>We address RQ1 in Section 5, RQ2 in Section 6, and RQ3 in Section 7.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="3.2">Identification and Selection Strategy</head><p>Search strategy. To identify relevant studies for RQ1 and RQ2, we used several methods: <ref type="bibr">(1)</ref> We collected a set of research papers that we were already familiar with that covered developers' tasks, their interaction with tools, and tools designed for working with design decisions in code.</p><p>(2) We also collected another set of related papers through searching literature databases, such as Google Scholar, DBLP, IEEEXplore, and the ACM digital library, using relevant keywords such as "developer tasks, " "developer tools, " "following rules, " "changing code, " "finding patterns, " and "detecting defects. " <ref type="bibr">(3)</ref> We then used snowballing to identify additional studies by examining the references of the papers we found and the studies that cited them. To identify prior surveys related to the tools we identified in RQ2, we searched literature databases using keywords such as "survey" and "overview, " as well as using the tool types in Section 5 as keywords. We then used further snowballing to identify recent surveys by examining surveys that cite older surveys.</p><p>Inclusion and exclusion criteria. The scope of the papers examined in this survey includes technical reports and papers presented at workshops, conferences, and journals in software engineering and human-computer interaction. To address RQ1, we included studies that focused on developers and their needs, goals, and challenges. For RQ2, we considered tools designed to support developers in completing tasks that involve working with various representations of design decisions, such as design patterns. We excluded studies and tools that were considered too preliminary, such as position papers, as well as tools that did not pertain to design decisions, such as debugging tools.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="3.3">Data Extraction</head><p>For each article about a tool, we made notes on the paper's self-positioning, including the tool's purpose and the tasks it supports, as well as its features, including its user interface. We also noted example use cases and potential future features of the tool mentioned in the paper.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="4">DEFINITIONS</head><p>In this section, we define several key concepts related to design decisions: software design, design decisions, design rationale, design rules, and design patterns. Software design. Software design is the process of creating a blueprint for a software system by defining, visualizing, creating, and testing the architecture, components, modules, and interfaces to fulfill specified requirements <ref type="bibr">[1,</ref><ref type="bibr">70]</ref>.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>Design decision.</head><p>In this article, we define a design decision as a choice between alternative technical approaches made to achieve a goal <ref type="bibr">[113]</ref>. For example, a design decision might be to choose the Proxy pattern <ref type="bibr">[59]</ref> instead of Facade or Factory <ref type="bibr">[59]</ref> to represent elements in a document editor. Design decisions may be characterized by the scope of their impact, ranging from low-level choices that impact a few lines of code, to cross-cutting architectural decisions that impact an entire codebase <ref type="bibr">[132]</ref>. Design decisions may be simple, compound, or cross-cutting. "Simple decisions have a Fig. <ref type="figure">1</ref>. An example argument in the QOC model of argumentation <ref type="bibr">[99]</ref>. Design choices are specified as questions (design choices), options (design alternatives), and criteria (properties and requirements). Fig. <ref type="figure">2</ref>. In the IBIS model of argumentation <ref type="bibr">[40]</ref>, design choices (issues) can be generalized, specialized, or create other design choices. Each design choice is accompanied by several design alternatives (positions) that are supported or opposed by arguments.</p><p>singular rationale and consequence. Compound decisions include several closely related rationales, but their consequences are generally contained in one component. Finally, cross-cutting decisions affect a wider range of components, and their rationale follows a higher-level concern such as the architectural quality of the system" <ref type="bibr">[132]</ref>. A variety of attributes may be associated with a design decision, such as its authors, history, area of impact (e.g., usability, security), current state (e.g., idea or implemented), risk, and cost <ref type="bibr">[80]</ref>.</p><p>Design rationale. Central to a design decision is its rationale <ref type="bibr">[117]</ref>. Design rationale describes the alternatives that were considered and the justification for why the selected alternative was chosen <ref type="bibr">[86,</ref><ref type="bibr">107]</ref>. For example, a developer may select the Proxy pattern <ref type="bibr">[58]</ref> in a document editor to reduce the cost of expensive object creations and only create them on-demand. Design rationale offers traceability that explicitly links requirements to the descriptions of artifact features that satisfy these criteria <ref type="bibr">[47]</ref>. Design rationale may be captured and represented informally or through more structured formal approaches <ref type="bibr">[39]</ref>. Informal approaches represent design decisions and rationale in raw documents <ref type="bibr">[24]</ref> or other communication artifacts such as email, chat, audio, or video that record the design process <ref type="bibr">[87]</ref>. Formal approaches impose a structure by which design decisions are represented through an argumentation model describing how the design decision was made and the rationale behind it <ref type="bibr">[47]</ref>, and as such they are widely known as design rationale models. For example, in Toulmin's model of argumentation, several elements are specified, such as a claim (a design decision), datum (data providing evidence for this claim), and a warrant that connects the claim and the datum <ref type="bibr">[143]</ref>. This model does not capture design alternatives or their arguments. Other prominent design rationale models are the Questions, Options, and Criteria (QOC) model <ref type="bibr">[99]</ref>, the Issue-Based Information System (IBIS) model <ref type="bibr">[39,</ref><ref type="bibr">123]</ref>, and model used in the Decision Representation Language (DRL) <ref type="bibr">[85]</ref>. In the QOC model, questions capture design choices, options describe design alternatives, and criteria enumerate properties and requirements that must be satisfied (Figure <ref type="figure">1</ref>). Each question is associated with several options, and each option may satisfy or violate criteria. Design rationale is illustrated through a diagram, where lines connecting questions and options represent arguments. Similar to QOC, IBIS diagrammatically represents design issues (Figure <ref type="figure">2</ref>). Specifically, in IBIS, issues (design choices), positions (design alternatives), and arguments are each diagram elements, and directed edges between them describe their relationships. This representation describes how a resolution is reached and a decision is made. IBIS influenced other design rationale models, including the Procedural Hierarchy of Issues (PHI) <ref type="bibr">[54]</ref> and the model proposed by Potts and Bruns <ref type="bibr">[120]</ref>, which itself was extended in the model of DRL <ref type="bibr">[85]</ref> by adding design rationale elements to the model (Figure <ref type="figure">3</ref>). The DRL model then inspired later argu-Fig. <ref type="figure">3</ref>. In the DRL model in RATSpeak <ref type="bibr">[28]</ref>, design decisions are specified as design choices (decision problems), design alternatives, and arguments, which encompass requirements that are supported or violate assumptions about alternatives and the relationship with other alternatives and claims (design decisions).</p><p>mentation models, such as the Design Document Model (DDM) <ref type="bibr">[67,</ref><ref type="bibr">77]</ref> (also inspired by QOC) and RATSpeak <ref type="bibr">[28]</ref>.</p><p>Design rule. After a selected alternative has been chosen, this selection imposes a set of constraints that code must follow to be consistent with the design decision. These constraints are design rules <ref type="bibr">[13]</ref>. Design rules impose "partial specifications to which the realization of one or more architectural [and non-architectural] entities have to conform to" <ref type="bibr">[72]</ref>. For example, applying the Proxy pattern <ref type="bibr">[58]</ref> to a document editor requires creating a proxy class and an entity class for each element in the editor, along with an editor class that may only access the proxy. Constraints may require or prohibit the existence of an entity or artifact, require specific properties for cross-cutting concerns (which may be hard to map to a specific location in source code), or constrain the conditions under which code is executed <ref type="bibr">[80]</ref>.</p><p>4.0.1 Design Pattern. While a design decision is most often considered to be a choice made in a specific situation, a design decision can also be considered as a more general, and reusable, choice that balances competing considerations. This perspective was best popularized in the form of a design pattern, offering a solution to a problem in a context <ref type="bibr">[58]</ref>. Many design patterns have been introduced, such as the GoF (Gang of Four) patterns on object-oriented design <ref type="bibr">[59]</ref>, patterns for Agile programming <ref type="bibr">[103]</ref>, patterns for enterprise software <ref type="bibr">[56]</ref>, and patterns for specific programming languages such as Java <ref type="bibr">[22]</ref>. Design patterns have often been closely associated with structural constraints on code elements, describing how a specific problem is solved by enumerating a few classes with specific roles and specifying constraints on their relationships (e.g., the Observer pattern <ref type="bibr">[59]</ref> decouples a subject from an observer by maintaining a list of observers that are notified of state changes). Similar to design patterns, architectural styles also offer reusable solutions to a problem. However, instead of constraining how a few classes are connected, instead constrain how all elements in a system are connected. For example, in the Model-View-Controller <ref type="bibr">[133]</ref>, three types of elements have constraints on their interactions throughout the system.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="5">TOOLS FOR INTERACTING WITH DESIGN DECISIONS IN CODE</head><p>A wide variety of tools have been proposed to support developers in working with design decisions in code. We identified 85 papers that introduce a tool that a developer may use to work with design decisions (Figure <ref type="figure">4</ref>). These tools can be categorized along several dimensions, including what a  developer is asked to do before or after making a design decision and how a design decision is represented. We used this categorization to created a taxonomy for tools (Figure <ref type="figure">4</ref>). The types of tools we survey and the primary tasks they are intended to support are listed in Table <ref type="table">1</ref>.</p><p>Most broadly, tools may support developer work with design decisions that are either explicitly captured and written down at the point when a developer makes a decision or that remain uncaptured. Tools have envisioned several ways to offer support for explicitly captured decisions. Design decisions may be represented through a link to a more generic form of the design decision, as found in Design Pattern Catalog Tools (Section 5.4). Or design decisions may be directly documented, either as the design rationale explaining the choice or the design rule associated with the design decision. Design rationale may be documented either explicitly, as alternatives and the criteria used to choose between them (Design Rationale Tools, Section 5.3), or less formally, through unstructured text (Documentation Tools, Section 5.1). Other tools focus on checking that code remains consistent with a design rule. These may focus either on higher-level architectural rules (System Architecture Tools, Section 5.5) or lower-level code rules (Static Analysis Tools, Section 5.2).</p><p>As design decisions are often not written down and explicitly captured when the design decisions were originally made, a wide variety of tools have been designed to help support developer work with uncaptured design decisions. Tools may support developers as they attempt to infer design decisions from examples (Reverse Engineering Tools, Section 5.6) or to hypothesize design decisions and test these hypotheses against code (Software Query Languages and Tools, Section 5.7). Fig. <ref type="figure">5</ref>. CODES <ref type="bibr">[150]</ref> generates JavaDoc from related discussions on Stack Overflow. Fig. <ref type="figure">6</ref>. Tutorons <ref type="bibr">[66]</ref> generates context-relevant documentation for explaining complex options and syntax, such as for the wget command, REGEX queries, and CSS selectors.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="5.1">Documentation Tools</head><p>Design decision documentation tools support systematic documentation of design decisions. While their primary purpose is to capture design decisions, documentation tools may also provide features to facilitate editing and updating design decisions over time, such as by linking design decisions to code <ref type="bibr">[68,</ref><ref type="bibr">104]</ref> (Figures <ref type="figure">9</ref> and<ref type="figure">14</ref>), visualizing the relationships among decisions <ref type="bibr">[90]</ref>, or generating documentation using external resources <ref type="bibr">[150]</ref> (Figure <ref type="figure">5</ref>). Documentation tools vary in how a decision is represented, which may be code-based or on-demand <ref type="bibr">[124]</ref>. In code-based documentation tools, design decisions are formulated as code patterns (e.g., ActiveDocumentation <ref type="bibr">[104]</ref>), with a focus on lower-level decisions. In contrast, on-demand documentation tools are responsive, generating documentation from external resources based on a user query. For example, CODES <ref type="bibr">[150]</ref> searches for related discussions in Stack Overflow and inserts found descriptions as JavaDoc documentation in the code (Figure <ref type="figure">5</ref>). Tutorons <ref type="bibr">[66]</ref> responds to user queries to generate code-specific documentation explaining complex options and syntax using prepared templates (Figure <ref type="figure">6</ref>).</p><p>Related Survey. While we focus on tools for documentation in this survey, prior work has surveyed techniques for documentation. Alexeeva et al. <ref type="bibr">[8]</ref> conducted a systematic literature review of approaches for documenting design decisions. They classified documentation techniques across five dimensions: goal, formalism for classifying decisions (e.g., properties or free-text), which decisions are documented, artifacts included with the decision, and tool-support.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="5.2">Static Analysis Tools</head><p>Static analysis tools check code for conformance against pre-defined rules <ref type="bibr">[151]</ref>. Static analysis tools may be used to check consistency between a design decision and code by checking that it follows the design rule reflecting the chosen alternative. Static analysis tools vary widely in their capabilities, including the types of rules they may check, their extensibility to new rules, the languages they support, and the developer experience of interacting with the tools (Table <ref type="table">2</ref>).</p><p>Static analysis tools are generally pre-configured to check for specific universal design rules that reflect constraints that should hold across all projects (e.g., PMD <ref type="bibr">[41]</ref>, FindBugs <ref type="bibr">[69]</ref>, and CheckStyle <ref type="bibr">[2]</ref>). An extensible static analysis supplements this with support for developers to themselves author custom rules. These rules may document and check design rules imposed by design decisions. Tools support a variety of techniques and notations by which developers may author project-specific design rules. Some offer libraries for writing rules as code while others use special-   ized notations. Rules may be expressed as constraints on information collected while traversing the Abstract Syntax Tree (e.g., CheckStyle, PMD), XPath queries (e.g., PMD), or XML (e.g., Design Fragments <ref type="bibr">[50]</ref>, (Figure <ref type="figure">7</ref>)). Some tools (e.g., Tricorder <ref type="bibr">[129]</ref> and RulePad <ref type="bibr">[105]</ref>) specifically emphasize their ability to empower all developers to write their own rules. Related Survey. In this survey, we categorize static analysis tools based on the scope of rules they check. Prior work <ref type="bibr">[91]</ref> categorized 25 program analysis tools based on their popularity in research and search engines, their purpose, and the programming languages they support.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="5.3">Design Rationale Tools</head><p>Design rationale tools enable developers to make the reasoning behind design decisions explicit by documenting, organizing, maintaining, and reusing rationale. Design rationale tools may be model-based, using an explicit argumentation model that describes alternatives and criteria used to choose between them, or artifact-based, linking to existing artifacts that include unstructured textual descriptions of rationale.</p><p>Model-based design rationale tools enable developers to explore documented rationale through visual diagrams or textual representations. Tools often represent the design rationale explicitly, identifying alternatives that were considered and the criteria with which a developer selected an alternative through an argumentation model (Section 4). Many tools support nesting design decisions, where an alternative may have design choices within it. Tools may display the argumentation model of alternatives and criteria through a visualization. Early tools such as InfoRat <ref type="bibr">[27]</ref> display argumentation models using a textual representation through lists of items. gIBIS <ref type="bibr">[40]</ref> uses the IBIS model to visualize design rationale as a graph, with nodes for issues (design choices), positions (alternatives), and arguments (Figure <ref type="figure">2</ref>). SEURAT <ref type="bibr">[29]</ref> lists design rationale information (including decisions, alternatives, and arguments) as levels in a tree (Figure <ref type="figure">8</ref>). DecDoc <ref type="bibr">[68]</ref> uses the Documentation Decision Model (DDM) <ref type="bibr">[67]</ref> to capture design decisions through two separate approaches: architectural design decisions UML diagrams and design decisions in code through annotations (Figure <ref type="figure">9</ref>). As graphs visualizing rationale may become large and cluttered, tools may make the diagrams zoomable (e.g., gIBIS) or collapsible (e.g., SEURAT), displaying details on demand (Figure <ref type="figure">8</ref>).</p><p>Tools may also support the process of evaluating design rationale. For example, SEURAT <ref type="bibr">[29]</ref> enables developers to annotate code fragments relevant to specific design issues, creating twoway links between rationale and code. Completeness and consistency is checked for violations of syntactic rules (e.g., multiple alternatives are selected) and semantic rules (e.g., the same argument is used for and against an alternative), with notifications of potential violations of requirements or when chosen alternatives may be non-optimal.</p><p>In contrast to model-based tools that explicitly represent alternatives, artifact-based tools offer links to existing artifacts containing text describing design rationale. Design rationale may be discussed on communication platforms such as chat and email. However, these artifacts are often disconnected from code and may be lost or forgotten. To support the use of these artifacts to explain rationale, artifact-based design rationale tools such as CodeLink <ref type="bibr">[157]</ref> and REACT <ref type="bibr">[9]</ref> organize design rationale information, automatically extracting discussion of rationale or enabling developers to annotate these discussions in non-code artifacts. CodeLink organizes emails containing rationale, making them easier to find by processing them to extract development contexts (i.e., time, project information, the author's task, and the author's development environment) and identify relevant source code. REACT enables developers to annotate design rationale elements (design choices, alternatives, pro-arguments, con-arguments, and decisions) in Slack.</p><p>Related Survey. In this survey, we classify design rationale tools into model-based and artifact-based tools. Prior work categorized early model-based design rationale tools, introduced Fig. <ref type="figure">10</ref>. SAVE <ref type="bibr">[78]</ref> visualizes dependencies between system components, indicating potential violations with an edge icon. Fig. <ref type="figure">11</ref>. Dependency-Structure Matrix tools visualize component dependencies in a matrix and indicate violations of dependency constraints (cells with triangles) <ref type="bibr">[5]</ref>.</p><p>between 1970 to 2000, as process-or feature-oriented, identified an argumentation model (e.g., IBIS, QOC), examined whether rationale was automatically extracted or captured from developers, and identified an information retrieval process (navigation, automatically triggered, query-based, or hybrid) <ref type="bibr">[122]</ref>.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="5.4">Design Pattern Catalog Tools</head><p>Design pattern catalog tools systematically collect known design patterns introduced for common problems, enabling a new decision to be documented and explained by referencing a prior generalized decision (e.g., adopting the Strategy pattern). Catalogs represent design patterns using structured templates that enumerate attributes, facilitating search and exploration. Most famously, the "Gang of Four" introduced a catalog of design patterns for object-oriented design. They described each pattern through 12 properties, including jurisdiction (elements where the pattern applies), characterization (the pattern's functionality), intent (the rationale of the pattern), and motivation (a scenario where it applies) <ref type="bibr">[58]</ref>. Later templates introduced a variety of additional properties, such as solution principle and runtime behavior <ref type="bibr">[30,</ref><ref type="bibr">46]</ref>. Catalog tools may also capture architectural patterns. Catalog tools may support extension to other types of patterns by modifying the underlying templates (e.g., SEURAT_Architecture <ref type="bibr">[154]</ref>).</p><p>By representing design patterns through structured templates, catalog tools enable browsing and search along the enumerated dimensions. For example, DRIMER supports identifying and understanding patterns by integrating design patterns, examples, and their rationale in a unified model called Design Recommendation and Intent Model (DRIM) <ref type="bibr">[116]</ref>. SEU-RAT_Architecture <ref type="bibr">[154]</ref> integrates rationale management with design patterns by recording attributes including positive and negative consequences.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="5.5">System Architecture Tools</head><p>System architecture tools enable developers to document architectural design decisions and check code against the constraints they impose. Two influential approaches are Reflexion Models (RM) <ref type="bibr">[78]</ref> and Dependency-Structure Matrices (DSM) <ref type="bibr">[130]</ref>. In RM tools, components are extracted from the code, visualized, and checked for conformance against a specified, intended architecture. For example, SAVE <ref type="bibr">[78]</ref> visualizes the system as a graph, where nodes represent the system components and edges represent dependencies (Figure <ref type="figure">10</ref>). Violations of constraints are illustrated with icons on edges. Like Reflexion Models, DSM tools capture dependency structure but display dependency structure in a matrix form. The rows and columns correspond to system components, and each cell in the matrix denotes dependencies between components. For example, in Lattix's Dependency Manager tool <ref type="bibr">[5]</ref>, rows and columns correspond to classes, and cells count directed dependencies between classes. Constraints on dependencies between classes may be defined by marking cells as allowed or forbidden, with violations reported through small triangles shown on cells (Figure <ref type="figure">11</ref>).</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="5.6">Reverse Engineering Tools</head><p>Reverse engineering tools extract design artifacts from a program to support developers in specified tasks <ref type="bibr">[37]</ref>. In this survey, we focus on reverse engineering tools that might be applicable to detecting potential design decisions in code. Reverse engineering tools may help developers infer design decisions by identifying frequently co-occurring code fragments, suggesting the presence of a design rule associated with a design decision. These tools assume that the more a pattern is repeated, the more likely that pattern is intentional and reflects an underlying design rule. Reverse engineering tools may also be used to detect design patterns. Working from a predefined set of attributes defining design patterns, tools may identify instances of these in code.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="5.7">Software Query Languages and Tools</head><p>Software query languages and tools enable developers to test a hypothesized design rule. Developers formulate a design rule as a query and then examine identified example code fragments that follow or violate the rule. Techniques vary in the query language used to express design rules, including general-purpose programming languages, domain-specific languages, and semi-natural languages.</p><p>General Purpose Programming Languages. Using general purpose programming languages to write queries reduces the required learning curve for the developer to learn the query language but adds complexity and overhead when writing complex queries. EG <ref type="bibr">[15]</ref> supports extracting common and idiomatic examples for a given API method, but with queries limited to API methods. ArchJava <ref type="bibr">[7]</ref> offers an architectural description language for checking architectural decisions against code, extending Java by adding constructs to define architectural components, connectors between components, and ports (sets of method calls). Domain-specific Languages. Domain-specific languages offer languages specifically designed for expressing queries, with widely varying complexity and expressiveness. Some query languages like Semmle.QL <ref type="bibr">[42]</ref> are similar to well-known languages such as SQL, reducing learning barriers. For example, a Semmle.QL query to find classes that only implement the compareTo method without implementing the equals method is written as:</p><p>from Class c where c.declaresMethod(''compareTo'') and not(c.declaresMethod(''equals'')) select c.getPackage(), c</p><p>Other query languages use novel notation, such as XPath in PMD <ref type="bibr">[41]</ref>, SOUL <ref type="bibr">[43]</ref> (a functional language), and Acme <ref type="bibr">[63]</ref> (an architecture description language). While offering considerable expressiveness, these languages require users to learn a new and often complex language to write queries. For example, a PMD XPath query to find classes without private fields is written as:</p><p>A SOUL query to find bar methods in classes is written as: if jtMethodDeclaration(?m) { public ?type bar(?paramList) { ?statements }; } And an Acme query checking that a connection C1 between components A and B implies a connection C2 is written as: Semi-natural Languages. Natural language is an expressive and natural approach for writing queries. However, natural language is often ambiguous and difficult to interpret. Therefore, many tools use specifically designed semi-natural languages that seek to remain close enough to natural language to benefit from their naturalness and expressiveness while introducing structure to reduce ambiguity. Browse-By-Query (BBQ) <ref type="bibr">[3]</ref> and srcQL <ref type="bibr">[16]</ref> use semi-structured grammars for expressing queries. A BBQ query to find bar methods in classes is written as:</p><p>matching "bar" methods in all classes A query in srcQL to find a function that contains an fopen() followed by an fclose() on the same variable is written as:</p><p>Architectural design rules may also be specified through semi-natural language. For example, a design rule in Dict&#333; <ref type="bibr">[36]</ref> for the model-view-controller architectural style may be specified as: </p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="6">DEVELOPER GOALS WHEN WORKING WITH DESIGN DECISIONS</head><p>To examine how developers can be better supported when working with design decisions, it is important to consider the goals they hope to accomplish. A goal specifies an objective that an individual seeks to achieve through a series of mental or physical activities <ref type="bibr">[64,</ref><ref type="bibr">98]</ref>. In programming tasks, goals encompass the tasks developers do (e.g., fix a defect, migrate to a new library version) as well as the questions and subgoals necessary to complete these tasks (e.g., determine the cause of a defect, determine the assignment statement that last wrote to a field). Goals often describe an objective by the developer to implement a change to a program or to gather information <ref type="bibr">[81,</ref><ref type="bibr">109]</ref>. In this survey, we consider goals developers may have when working with a design decision, examining the situations where developers may work with a design decision and how tools might effectively support these situations.</p><p>Broadly, a design decision can be thought of as transitioning through a lifecycle. It is first created, impacts subsequent work, and, eventually, may be revisited and changed. To make a design decision, a developer first formulates a problem. For many programming problems, there may be more than one solution, each with positive and negative consequences <ref type="bibr">[96]</ref>. Developers may collect and evaluate each alternative, considering their advantages and disadvantages as well as existing design constraints <ref type="bibr">[20]</ref>. After a design decision is made, it may be captured by the developer in, for example, a design document so future developers can understand it <ref type="bibr">[114]</ref> and prevent knowledge vaporization <ref type="bibr">[33]</ref>. However, in practice, many design decisions remain uncaptured, undocumented, and tacit in the heads of decision-makers <ref type="bibr">[72,</ref><ref type="bibr">147]</ref>. Over time, to understand, Determine why an alternative was selected After seeing that communication is mediated through Command patterns, the developer tries to determine why it was selected instead of a Publish/Subscribe approach.</p><p>maintain, and reuse code, developers need to understand related design decisions <ref type="bibr">[127]</ref> to follow and to be consistent <ref type="bibr">[79,</ref><ref type="bibr">137]</ref>. To detect uncaptured design decisions, developers may apply reverse engineering techniques to find implicit design decisions in code <ref type="bibr">[18]</ref>, or may conjecture design decisions by generating hypotheses and testing them by examining the code <ref type="bibr">[138]</ref>. When considering changing design decisions, developers often seek to understand their rationale <ref type="bibr">[72,</ref><ref type="bibr">107,</ref><ref type="bibr">137]</ref>, which is the most frequently reported category of hard-to-answer questions by developers <ref type="bibr">[83]</ref>.</p><p>From this, we identified six key goals developers may have in working with design decisions: (1) identify potential alternatives, (2) select an alternative as a design decision, (3) document the chosen alternative, (4) check a hypothesized design decision against code, (5) find and follow relevant design decisions, and (6) determine why an alternative was selected (Table <ref type="table">3</ref>).</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="7">SUPPORTING DEVELOPER GOALS</head><p>While many tools are most closely associated with a single goal (the primary task identified in Table <ref type="table">1</ref>), many offer at least partial support for a wider variety of developer goals. In this section, we consider how a wide variety of approaches may offer support for each of the goals we pinpointed in the previous section and the challenges that may exist in achieving this support. Table <ref type="table">4</ref> summarizes the support tools may offer developers in achieving these goals and the challenges developers may have when using these tools.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="7.1">Goal 1: Identify Potential Alternatives</head><p>When developers face a problem writing code, they must find a solution <ref type="bibr">[135]</ref>. To this end, developers may identify a range of potential solutions for further examination <ref type="bibr">[20,</ref><ref type="bibr">96]</ref> from multiple sources, including novel solutions <ref type="bibr">[31,</ref><ref type="bibr">110]</ref> as well as reusing solutions and ideas from other projects <ref type="bibr">[55,</ref><ref type="bibr">102,</ref><ref type="bibr">148,</ref><ref type="bibr">149]</ref> and developers' own past experiences <ref type="bibr">[100]</ref>. Developers may also brainstorm and discuss ideas with their team <ref type="bibr">[100]</ref>. Solutions may also be adapted from solutions to similar problems found within a developer's own project <ref type="bibr">[35,</ref><ref type="bibr">100]</ref>. Developers may also draw on solutions to more general problems, such as those written in tutorials, blog posts, books, or other mediums.</p><p>Tools may support developers in finding potential alternatives to a design problem, either by helping developers identify and understand similar decisions made within their own project or by helping identify general solutions to problems to adapt and reuse. For example, design rationale tools might help developers by recording a number of alternative solutions that they have consid-  -Usefulness of tools depends on the existence, clarity, and correctness of the documentation.</p><p>-Developers need to map from the language used in the tool to that in their code.</p><p>+ Developers may reuse documented alternatives if applicable.</p><p>-Usefulness of tools depends on the existence, clarity, and correctness of the documentation.</p><p>-Developers need to map from the language used in the tool to that in their code.</p><p>-No Support.</p><p>+ Developers can look up the related design decisions if documented.</p><p>-Usefulness depends on the existence, clarity, and correctness of the documentation.</p><p>-Developers need to map from the language used in the tool to that in their code.</p><p>+ Developers can look up the related design decisions if documented.</p><p>-Usefulness of tools depends on the existence, clarity, and correctness of the documented decisions.</p><p>+ Developers can look at rationale of documented design rules in the tool.</p><p>-Usefulness depends on the existence, clarity, and correctness of the documented decisions.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>Static Analysis Tools</head><p>-No Support.</p><p>-No Support.</p><p>+ Developers may document the chosen alternatives if the tools support custom rule authoring.</p><p>-Developers need time, effort, budget, and motivation to use the tools.</p><p>-Developers need to have specialized knowledge and expertise to write checkable rules. + Developers can author design rules in the tool and use the tool to check the code for conformance.</p><p>-Developers need specialized knowledge and expertise to write checkable rules and interpret the results. + The tool checks the code against the rule for conformance.</p><p>-Usefulness depends on the existence, clarity, and correctness of the documented decisions. + If recorded, then developers can examine the rationale of design rules using the tool.</p><p>-Usefulness depends on the existence, clarity, and correctness of the documented decisions.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>Design Rationale Tools</head><p>+ Developers may search for and reuse documented decisions, if they exist.</p><p>-Usefulness depends on the existence, clarity, and correctness of the documented design rationale.</p><p>-Developers need to map between the language used to describe rationale and that in their code.</p><p>+ Developers may reuse documented alternatives, if applicable.</p><p>-Usefulness depends on the existence, clarity, correctness, and language of the documented design rationale.</p><p>-Developers need to map from the language used in describing rationale to that in their code.</p><p>+ Developers can document the decision rationale using the tool.</p><p>-Developers need time, effort, budget, and motivation to use the tools.</p><p>+ Developers can look up decisions documented in the tool.</p><p>-Usefulness depends on the existence, clarity, and correctness of the documented design rationale.</p><p>-Developers need to map from the language used in describing the rationale to that in their code. + Developers can look up decisions documented in the tool.</p><p>-Usefulness depends on the existence, clarity, and correctness of the documented design rationale.</p><p>-Developers need to map from the language used for in describing rationale to that in their code.</p><p>+ Developers can use the tool to examine the rationale of design rules.</p><p>-Usefulness depends on the existence, clarity, and correctness of the documented design rationale.</p><p>-Developers need to map the language used for the rationale and their code.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>Design Pattern Catalog Tools</head><p>+ Developers may search and look at catalog of design patterns and find design pattern that addresses challenges.</p><p>-Usefulness of tools depends on the existence, clarity, and correctness of the documented design patterns.</p><p>-Developers need to map from the identifiers using in the design patterns to those in their code.</p><p>+ Developers can see consequences defined for design patterns in the catalog.</p><p>-Usefulness depends on the existence, clarity, and correctness of the documented design patterns.</p><p>-Developers need to map from the identifiers used in the design patterns to those in their code.</p><p>+ Developers who are familiar with the design pattern catalog may use the identifiers to find the patterns in code.</p><p>-Developers need time, effort, budget, and motivation to use the tools.</p><p>+ Developers who are familiar with the design pattern catalog may use the identifiers to find the design patterns in code and make changes consistently.</p><p>-Usefulness depends on the existence, clarity, and correctness of the documented design patterns.</p><p>-Developers need to map design pattern identifiers to their code.</p><p>+ Developers can use identifiers to match the design patterns in the catalog and to make changes consistently.</p><p>-Usefulness depends on the existence, clarity, the correctness of the documented design patterns.</p><p>-Developers need to map design pattern identifiers to those in their code.</p><p>+ Developers may go to the catalog to see why an alternative might have been chosen.</p><p>-Usefulness depends on the existence, clarity, and correctness of the documented design patterns.</p><p>-Developers need to map from the language used in the documented rationale to their code.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>System Architecture Tools</head><p>-No Support.</p><p>-No Support.</p><p>+ Developers can configure the intended architecture in the tool.</p><p>-Developers need time, effort, budget, and motivation to use the tools.</p><p>+ Developers can test hypothesized decisions.</p><p>-Usefulness depends on the existence, clarity, and correctness of the documented decisions.</p><p>-Developers need to have specialized knowledge to test decisions and interpret the results.</p><p>+ The tool visualizes the system architecture and shows inconsistencies with the intended architecture.</p><p>-Usefulness depends on the existence, clarity, and correctness of the documented decisions.</p><p>-Developers need to interpret the models.</p><p>+ Developers may look up the rationale if documented.</p><p>-Usefulness depends on the existence, clarity, and correctness of the documented rationale.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>Reverse Engineering Tools</head><p>+ Developers can identify and compare existing alternative implementations of a behavior.</p><p>-Developers need to interpret the results.</p><p>-The results depend on the tool configurations.</p><p>-No Support.</p><p>-No Support.</p><p>-No Support.</p><p>+ Tools may help find relevant design rules and identify any inconsistencies.</p><p>-Developers need to interpret the results.</p><p>-Tools may produce false positives.</p><p>-No Support.</p><p>Software Query Languages and Tools + Developers can write queries to look for and compare existing implementations of a behavior.</p><p>-Developers may need specialized knowledge to write queries and interpret the results.</p><p>-No Support.</p><p>-No Support.</p><p>+ Tools may help check for hypothesized decision in code.</p><p>-Developers may need specialized knowledge to write queries and interpret the results. + Developers may formulate queries and compare results to find inconsistencies.</p><p>-Developers may require specialized knowledge to write queries and interpret the results.</p><p>-Tools may produce false positives.</p><p>-No Support.</p><p>ered in the past <ref type="bibr">[127]</ref>. The following subsections describe the ways in which different tools may offer support in achieving this goal.</p><p>7.1.1 Documentation Tools. Documentation tools document design decisions with information that may inform developers about their potential applicability to future design problems. Documentation tools may help developers look for related design decisions <ref type="bibr">[156]</ref> and understand the rationale behind these choices. For example, in ActiveDocumentation <ref type="bibr">[104]</ref>, design decisions are associated with labels to help developers locate decisions relevant to a specific topic. Developers may then read descriptions of design decision to understand their rationale and find code examples that illustrate decisions.</p><p>7.1.2 Design Rationale Tools. Documented design rationale may help developers in reusing design decisions <ref type="bibr">[47]</ref>. Model-based design rationale tools document design rationale by capturing design choices, alternatives, arguments for or against the alternatives, and rationale (Section 5.3). If design decisions share a similar context, then their alternatives may be applicable <ref type="bibr">[88]</ref>. Documented alternatives may potentially be reused when a developer makes new design choices <ref type="bibr">[23,</ref><ref type="bibr">102,</ref><ref type="bibr">116]</ref>. However, arguments used in making a past design choice may no longer apply, as these may depend on the specific context of past design choices <ref type="bibr">[88]</ref>. Even when alternatives do not apply directly, they may inspire new alternatives <ref type="bibr">[31,</ref><ref type="bibr">100]</ref>.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="7.1.3">Design Pattern Catalog Tools.</head><p>Design patterns offer a solution to a problem in a context <ref type="bibr">[58]</ref>, offering developers a menu of readily available alternatives with which to solve problems. For example, to implement an element that may take one of multiple forms (e.g., graphical elements in an editor), the developer can look at the Gang of Four patterns for object jurisdiction and structural purpose <ref type="bibr">[59]</ref>. Design pattern catalog tools support working with patterns, describing each with properties including their type, scope, intent, and motivation <ref type="bibr">[55]</ref>. Many design pattern catalog tools offer features to facilitate the search and exploration process. A developer may browse patterns supporting the intent of creating objects in DRIMER <ref type="bibr">[116]</ref>. Tools such as SEURAT_Architecture <ref type="bibr">[154]</ref> visualize design patterns and their properties in tree structures and maintain links to code fragments where the patterns are applied.</p><p>7.1.4 Reverse Engineering Tools. Reverse engineering tools transform code into abstract forms and extract information to detect unknown design rules and design patterns, which may be used as alternatives for new design decisions. In many tools, extracted potential design rules are presented as code fragments without description or rationale (e.g., Reference <ref type="bibr">[139]</ref>), and it is left to developers to evaluate the fragments and infer a design rule and rationale. To do this, developers may examine the mined code fragments in the context of the codebase <ref type="bibr">[138,</ref><ref type="bibr">139]</ref>. Developers may then consider if the discovered design rules are solutions to their design problem. For example, a tool might extract code fragments that suggest to the developer the presence of a factory or prototype pattern, which the developer might then consider as alternatives when deciding how to support extensibility. 7.1.5 Software Query Languages and Tools. Software query languages and tools enable developers to query code to answer questions. Using these to identify alternatives may require more knowledge of the codebase than other tools, as the developer must first formulate an idea of a design or implementation to create a query. For example, a developer considering how to support extensibility might use a software query language to look for implementations of the Factory or Prototype pattern in their codebase.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="7.1.6">Challenges.</head><p>A central challenge with documentation and design rationale tools is the quality (e.g., clarity and correctness) of the content developers write down. If the documentation is vague, incomplete, or incorrect, then it may mislead developers and create more harm than good <ref type="bibr">[92]</ref>. Creating documentation is usually considered a burden imposed on developers <ref type="bibr">[71,</ref><ref type="bibr">106]</ref>, and developers often skip documenting or maintaining the documentation of design decisions <ref type="bibr">[92]</ref>. As a result, documentation is often missing, outdated, or incomplete <ref type="bibr">[92]</ref>, and many assumptions made when making decisions remain undocumented <ref type="bibr">[62]</ref> (see Section 7.3.5). It is crucial for tools to consider ways in which the burden for developers in creating documentation might be reduced, such as by reducing the effort to create the documentation or providing immediate benefits that the authors of documentation receive in completing their task.</p><p>Another challenge developers face is bridging the gap between the concepts and language they use in framing their new design problem and the language and the vocabulary used in describing existing problems in documentation, catalogs of design patterns, and other artifacts. Concept assignment (matching human-oriented concepts to code or context) <ref type="bibr">[21]</ref>, the potential for vocabulary mismatch (differences in word choices) <ref type="bibr">[57]</ref>, and domain-specific vocabulary used in existing artifacts are key barriers to reusing information within existing artifacts <ref type="bibr">[62]</ref>. In documentation tools and design rationale tools, documented decisions and alternatives are often described with system-specific terms and context <ref type="bibr">[102,</ref><ref type="bibr">131]</ref>. This may make it hard for developers to understand how to generalize and relate these decisions to the design problem they face. In contrast, design pattern catalogs take a step towards instead employing a generalized and standardized vocabulary. But there may still be challenges in adapting this terminology back to the context of the problem the developer is considering.</p><p>Reverse engineering alternatives from existing code brings additional challenges. Rather than produce alternatives that can be readily considered, these tools instead produce code snippets. Developers must then examine the code snippets to infer alternatives, which may require additional knowledge and effort. To write queries using software query languages and tools, developers need knowledge about the design and implementation of the code (Section 7.1.5) and may need to learn new specialized domain-specific languages (Section 5.7), knowledge that developers may lack <ref type="bibr">[105]</ref>. In reverse engineering tools, technical limitations can cause challenges, as the quality of the results depends heavily on the tool configuration, including the criteria used to find matches and specific threshold values chosen (e.g., References <ref type="bibr">[17,</ref><ref type="bibr">93]</ref>). For example, reverse engineering tools based on code clone detection techniques may ignore code fragments with few occurrences <ref type="bibr">[17]</ref>. In software query languages and tools, developers find code snippets by writing queries, and as such, incorrect queries lead to incorrect results.</p><p>Takeaways. When searching for potential alternatives, developers can leverage previously documented design decisions and the alternatives they encode from various sources. If decisions have been documented, then they might leverage those in design rationale, documentation, or design pattern catalog tools. However, this may bring challenges with mapping the language used in documentation to that in the problem the developer is currently considering. Developers can also identify potential alternatives by examining existing code, including theirs, and they may receive some assistance from tools such as reverse engineering and software query languages and tools. However, these tools only produce code snippets, not alternatives, and developers need to themselves have the knowledge necessary to infer the design alternative from the code snippet, a process that may also require considerable effort.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="7.2">Goal 2: Select an Alternative as a Design Decision</head><p>After identifying potential alternatives, developers must select one of the alternatives as the solution to their design problem. To choose a solution, developers need information about each alternative to understand its consequences. Developers consider and compare alternatives, weighing their consequences, and may externalize their thinking through whiteboards or notes <ref type="bibr">[101]</ref>. In choosing an alternative, developers may consider the concerns addressed, impacted decisions, assumptions and decisions that limit viable alternatives, and pros and cons of choosing each <ref type="bibr">[20,</ref><ref type="bibr">145]</ref>.</p><p>A variety of developer tools and techniques may help support choosing between potential alternative solutions to a problem. Tools such as documentation tools enable developers to evaluate and reuse existing design decisions. These tools collect design decisions with information such as a description or rationale that help developers maintain consistency in decision-making and support principled decision-making <ref type="bibr">[136]</ref>. Design rationale helps developers make important architectural decisions more rigorously and methodically <ref type="bibr">[52]</ref>. Developer tools such as design rationale tools support developers in selecting an alternative by gathering information on alternatives, such as a description and consequences, in structured formats. By including information about rationale and consequences, design pattern catalog tools may assist developers in identifying advantages and disadvantages of applying a design pattern for a specific problem.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="7.2.1">Documentation Tools.</head><p>Code-based documentation tools record design decisions with information such as descriptions and rationale supporting developers in evaluating and selecting an alternative. For example, in ActiveDocumentation <ref type="bibr">[104]</ref> each design decision is documented with a title, a description that may contain the rationale, labels specifying the scope of design decisions, and violated and example code snippets extracted from a codebase. When considering documented decisions as alternatives for another design choice, ActiveDocumentation helps developers in evaluating the alternatives by providing information about design rationale in descriptions and related scopes and concepts through labels.</p><p>On-demand documentation tools that provide rich explanations for selected code snippets may also support developers in evaluating alternatives. For example, CODES <ref type="bibr">[150]</ref> generates JavaDoc for a method using Stack Overflow discussions, which might contain useful information for evaluating the method when considered as an alternative.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="7.2.2">Design Rationale Tools.</head><p>Model-based design rationale tools record information about design rationale, enabling developers to assess and choose alternatives <ref type="bibr">[26,</ref><ref type="bibr">47]</ref>. In design rationale tools, each alternative is accompanied by opposing and supporting arguments, and if an alternative is reused, then the associated arguments can be considered in evaluating the alternative. For example, in tools that apply the QOC model <ref type="bibr">[99]</ref>, each design choice ("question") is associated with alternatives ("options"), and each option satisfies some "criteria" and violates other criteria. Similarly, in tools applying IBIS <ref type="bibr">[123]</ref>, each design choice ("issue") is associated with several alternatives ("positions") with advantages and drawbacks discussed in "arguments. " Using these, developers may assess each alternative by examining its associated arguments to choose an option.</p><p>To help choose alternatives, design rationale tools visually present design rationale information <ref type="bibr">[27,</ref><ref type="bibr">29,</ref><ref type="bibr">140]</ref>, support discussing decisions with teammates <ref type="bibr">[40]</ref>, and notify developers about missing or incorrectly chosen alternatives <ref type="bibr">[29]</ref>. Design rationale tools present documented rationale models through diagrams <ref type="bibr">[29,</ref><ref type="bibr">140]</ref> or textual representations <ref type="bibr">[27]</ref>. Design rationale diagrams often are intended to clearly illustrate the relationships among elements in the design rationale model <ref type="bibr">[29,</ref><ref type="bibr">40,</ref><ref type="bibr">140]</ref>. Textual representations of design rationale information are often used in Model-free tools, offering search features to help developers locate relevant information <ref type="bibr">[9,</ref><ref type="bibr">157]</ref>. In textual representations, the relationship between different elements can be less clear, and it can be hard to obtain a broad understanding of all design rational elements. Some design rationale tools support developers' collaboratively discussing design rationale <ref type="bibr">[40]</ref>. This is particularly useful for collaboratively making choices about specific issues, such as high-level design choices that impact several parts of the system and that are maintained by different developer teams <ref type="bibr">[47]</ref>. These choices require communication between developers with varying skills and objectives <ref type="bibr">[47]</ref>. Finally, tools may also support choosing alternatives by detecting inconsistencies among alternatives. For example, SEURAT examines the arguments of selected alternatives to identify incorrect decisions or arguments early in the design process and evaluate design decisions and alternatives <ref type="bibr">[29]</ref> 7.2.3 Design Pattern Catalog Tools. Design pattern catalog tools record design pattern information in a structured format, making it easier for developers to directly compare alternatives across specific dimensions. Pattern catalogs record information such as descriptions, intent, characterizations, motivation, and implementation details. These attributes may assist developers in evaluating design patterns from a particular perspective. For example, in SEURAT_Architecture <ref type="bibr">[154]</ref> developers can compare design patterns by analyzing the attributes affected by each design pattern.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="7.2.4">Challenges.</head><p>Using documentation tools, design rationale tools, or design pattern catalogs to select an alternative may impose challenges on developers. To successfully select an alternative, information about each alternative should be clear and coherent. Incorrect documentation may misguide developers. Language may also impose a barrier. In reusing and adapting design choices <ref type="bibr">[102]</ref>, developers must understand the details of the design decisions and map the language used in the recorded alternative to the new project context.</p><p>Takeaways. Developers evaluate and compare alternatives to make a design decision. To accomplish this, they may examine information previously captured for each alternative. For instance, developers can review the rationale behind an alternative if it is documented in design pattern catalog tools, design rationale tools, or documentation tools. The usefulness of these tools depends on the quality of the documented information, as clear and coherent documentation is necessary to effectively evaluate and compare alternatives.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="7.3">Goal 3: Document the Chosen Alternative</head><p>After making a design decision or discovering an undocumented design decision, developers may document a design decision to avoid knowledge vaporization <ref type="bibr">[65]</ref>. Documentation may also help developers to identify potential design alternatives when facing similar problems in the future <ref type="bibr">[142]</ref> (Section 7.1.1). Developers may document a variety of information about a design decision, including a description of the decision, often written with project-specific vocabulary, and a rationale describing its reasoning and justification <ref type="bibr">[80,</ref><ref type="bibr">115,</ref><ref type="bibr">145]</ref>.</p><p>Tools change the process by which developers document a design decision by prescribing a format and structure in which it is documented. Model-based design rationale tools use models to record design decisions and provide a history of the decision-making process. Design pattern catalog tools document the information of design patterns in a structured format, prescribing a template to capture specific attributes. Static analysis tools differ in focusing on documenting the design rule, ensuring the conformance of code to the rule, and focus less on offering rationale motivating the choice. Similarly, system architecture tools document architectural design rules about the allowed dependency structure of code and check code for conformity.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="7.3.1">Static Analysis Tools.</head><p>Extensible static analysis tools support developers in documenting specific types of design rules in a checkable format. Tools such as PMD <ref type="bibr">[41]</ref> and FindBugs <ref type="bibr">[69]</ref> find inconsistencies in code by documenting design rules, checking code, and reporting violations. Many design rules can be expressed as AST patterns <ref type="bibr">[105]</ref>, enabling the rule to be documented in a checkable representation. To use these tools to capture project-specific design rules, rather than the general defect patterns for which many of these tools were originally designed, developers must use the extensibility features of these tools to author their own rules. Tools require developers to author rules in special notations or write program analysis code in general purpose programming languages. For example, in PMD, developers can author custom rules by writing XPath queries describing a prohibited code pattern <ref type="bibr">[118]</ref>. XPath is a query language for XML data, in this case, the XML representation of the AST of the code. <ref type="foot">1</ref> To enable developers to write XPath queries, PMD provides PMD Designer <ref type="bibr">[119]</ref> that, given input code, produces the XML representation, executes an XPath query on it, and presents the result as code fragments (Figure <ref type="figure">12</ref>).</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="7.3.2">Design Rationale Tools.</head><p>Design rationale tools enable developers to document information about design decisions, such as considered alternatives and explanations of their decision rationale with supporting and opposing arguments (Section 5.3). Design rationale tools may be model-based or artifact-based, which vary in flexibility and precision. Model-based tools store information in predefined models (Section 4), limiting flexibility in what can be documented but supporting extensive detail <ref type="bibr">[29,</ref><ref type="bibr">40]</ref>. Artifact-based tools document design rationale in unstructured text, offering flexibility but lacking the ability to check that specific information is written down <ref type="bibr">[157]</ref>.</p><p>In model-based design rationale tools, developers document elements of design rationale, which is then visualized through diagrams. Depending on the model, developers may document information such as design choices, alternatives, and relationships between issues or alternatives (Sections 4 and 5.3). For instance, SEURAT <ref type="bibr">[29]</ref> uses the DRL model to document decisions, alternatives, arguments for and against each alternative, and links to related code fragments in the codebase.</p><p>In artifact-based design rationale tools, tools automatically or through manual steps extract and annotate relevant information from informal artifacts generated by developers. For example, CodeLink <ref type="bibr">[157]</ref> collects and processes emails sent by developers to extract design rationale, finding and documenting information such as context and related code snippets from email text.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="7.3.3">Design Pattern Catalog Tools.</head><p>Design pattern catalog tools document design patterns by documenting properties for each design pattern. They are often preconfigured with standard design patterns such as the 26 Gang of Four patterns <ref type="bibr">[58]</ref>. Tools may be extensible, enabling developers to document new design patterns by filling out templates. For example, SEUART_Architecture <ref type="bibr">[154]</ref> offers a template recording name, type (e.g., architectural pattern or code idiom), description, and consequences. 7.3.4 System Architecture Tools. System architecture tools document architectural design decisions and visualize these through diagrams or matrices. For example, SAVE <ref type="bibr">[78]</ref>, a reflexion model tool <ref type="bibr">[108]</ref>, lets developers author design rules constraining dependencies between components and visualizes these in a graph (Figure <ref type="figure">10</ref>). Lattix <ref type="bibr">[5]</ref> depicts dependencies between components using a dependency-structure matrix. Architectural design decisions are documented by setting constraints on matrix cells that allow or forbid specific dependencies (depicted by the yellow corner triangles on cells in Figure <ref type="figure">11</ref>).</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="7.3.5">Challenges.</head><p>In offering developers tool support with which they may document a chosen alternative, the key challenge is motivating developers to choose to document the decision in the first place. Despite admitting the importance and value of documentation, many developers report avoiding documenting decisions <ref type="bibr">[53,</ref><ref type="bibr">142]</ref> or documenting decisions without rationale <ref type="bibr">[47,</ref><ref type="bibr">51,</ref><ref type="bibr">106,</ref><ref type="bibr">141]</ref> due to reported barriers with the time, effort, and budget required <ref type="bibr">[26,</ref><ref type="bibr">34,</ref><ref type="bibr">86,</ref><ref type="bibr">142]</ref>. Developers report that they often have limited time and resources, which creating documentation requires. Many report that they postpone updating documentation, leading to knowledge vaporization <ref type="bibr">[32,</ref><ref type="bibr">65,</ref><ref type="bibr">84]</ref>. Developers may be poorly motivated due to the inadequate rewards developers receive for creating documentation <ref type="bibr">[65,</ref><ref type="bibr">89]</ref>. Documenting decisions may be particularly challenging when the act of documenting is disconnected from the process of making the decision <ref type="bibr">[54]</ref>. Developers also report personal reasons to skip documentation, such as being unaware they made a decision at all <ref type="bibr">[33,</ref><ref type="bibr">65,</ref><ref type="bibr">142]</ref>, concealing decisions and their rationale to avoid being challenged <ref type="bibr">[33,</ref><ref type="bibr">142]</ref>, or believing that they will not reuse the decisions in the future <ref type="bibr">[33]</ref>.</p><p>Documenting a design rule in a checkable format using static analysis tools brings important advantages in making it possible to check new code against design rules and notify developers when their code is inconsistent. But to do so, developers need special knowledge to use specialized notations with which to write design rules. For example, to write a custom rule in PMD <ref type="bibr">[41]</ref>, developers need to translate the intended rule into an XPath query or write program analysis code in Java (Section 5.2) <ref type="bibr">[105]</ref>. Another challenge is formulating the rule itself (specialization) <ref type="bibr">[105]</ref>. While developers may have an intuition about the rule and its implications, they may struggle to transform the rule into an abstract format and formulate it as an AST pattern. To address this challenge, RulePad offers other representations of design rules, snippet-based templates and seminatural language, to help novice and experienced developers author design rules (Figure <ref type="figure">13</ref>). The code-based template allows non-expert developers author design rules in templates that resemble code, and the semi-natural-language authoring allows experienced developers author design rules as unambiguous and structured textual representations <ref type="bibr">[105]</ref>.</p><p>Takeaways. Once an alternative has been chosen, developers may choose to document information about their decision. This can be achieved using various tools, such as static analysis tools for documenting checkable design rules, design pattern catalog tools for recording design patterns, or system architecture tools for documenting architectural design decisions. The primary obstacle in documenting decisions is motivating developers to devote the necessary time, effort, and resources. To overcome this challenge, tools may provide incentives by offering benefits not just for understanding the decision later but for the process of making the decision, such as informing developers of code that may violate a decision a developer has just made. </p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="7.4">Goal 4: Check Hypothesized Design Decisions against Code</head><p>When formulating new design decisions, developers may check these design decisions against the decisions and code that already exist. Tools may offer support to developers by letting them compare a hypothesized design decision against those that have already been documented or to test a design rule associated with a design decision against the code. Despite the existence of tools for documenting design decisions, design decisions often remain implicit and hidden in the code <ref type="bibr">[84]</ref>. In these cases, developers may work to reverse engineer them from code or other artifacts. To uncover hidden design decisions, developers investigate artifacts such as the code, hypothesize potential design decisions, and check if these are consistent with the code <ref type="bibr">[138]</ref>.</p><p>7.4.1 Documentation Tools. Using code-based documentation tools, developers may compare a hypothesized decision to design decisions that have been documented. To the extent that documentation is correct, contradictions suggest hypotheses may be incorrect. For instance, if a developer hypothesizes that a set of elements interact through the mediator pattern (one of the GoF patterns <ref type="bibr">[59]</ref>), but documentation indicates events are used instead, then this might indicate the hypothesis is incorrect. Some code-based documentation tools support developers in finding relevant design decisions. For example, ActiveDocumentation <ref type="bibr">[104]</ref> maintains links between code and design decisions and marks related decisions with tags (corresponding to concepts used in code), enabling developers to search for decisions related to specific code or concepts in question.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="7.4.2">Static Analysis Tools.</head><p>In documenting and checking design rules, static analysis tools such as PMD <ref type="bibr">[119]</ref> and FindBugs <ref type="bibr">[69]</ref> also offer a repository of design rules. As discussed in Section 7.3.1, extensible static analysis tools enable developers to write new project-specific design rules. In this way, static analysis tools may be used to test hypothesized design rules against code. 7.4.3 Design Rationale Tools. Design rationale tools may support developers in comparing new hypothesized decisions against existing documented decisions. Developers may manually check if a hypothesized decision can be inferred from or is consistent with documented design rationale. 7.4.4 Design Pattern Catalog Tools. By capturing and presenting well-known and projectspecific design patterns in structured formats, developers may use design pattern catalogs to compare potential new decisions against those that have already been made. Like documentation and design rationale tools, documented information may help developers identify inconsistencies or conflicts between decisions. 7.4.5 System Architecture Tools. For decisions that are architectural and reflect constraints on relationships between elements in a system, system architectural tools may help developers to understand how existing decisions relate to a new hypothesized decision or even to directly test decisions for their consistency with existing code. A diagram or matrix representation of dependency structures in a project may help developers see quickly, at a glance, how new hypothesized decisions relate to those that already exist. For example, a developer hypothesizing that a portion of the system is implemented as a layered architecture might quickly look for this structure in a DSM diagram. For tools that implement conformance checks against code, developers may even go a step further and test a new hypothesized decision against code. A developer might formulate a new constraint for the layer and then test code for conformance against it.</p><p>7.4.6 Software Query Languages and Tools. Software query languages and tools enable developers to test rules associated with hypothesized decisions by formulating these rules as queries. Tools support developers by executing them against code and inspecting matching code snippets. For this purpose, developers need to formulate their proposed design rules in a format executable by software query languages and tools and examine the snippets that follow or violate the rules.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="7.4.7">Challenges.</head><p>In cases where documentation is maintained and updated, tools that help structure and organize this may make it easier for developers to gather relevant information to check if their newly formulated decisions are consistent with code. However, as discussed in Section 7.3.5, decisions are often not documented. When documentation is not available, developers use source code as the primary source of information and reverse engineer design decisions <ref type="bibr">[84]</ref>.</p><p>Tools can offer important support in testing rules associated with decisions against code. But they impose several important barriers on developers. As discussed in Section 7.3.5, developers must translate their newly formulated decisions into checkable formats executable by the tools, which may require specialized knowledge to write. Another challenge is interpreting the results. Tools often present the results without sufficient explanation (e.g., CloneDR <ref type="bibr">[19]</ref>). Developers may have difficulty distinguishing accidental patterns from intentional design decisions.</p><p>Takeaways. When exploring code, developers often hypothesize design decisions that may have been made. To verify these hypotheses, developers can compare them against design decisions that have been previously documented in various tools, such as documentation tools, design rationale tools, design pattern catalog tools, static analysis tools, and system architecture tools. However, the usefulness of these tools is contingent on the existence, accuracy, and clarity of the information documented within them. To validate their hypotheses, developers can also inspect the code. They may use tools, such as static analysis tools, system architecture tools, and software query languages, to search for instances of their hypotheses within the code. However, to achieve success, developers must possess specialized knowledge to use these tools to express their hypotheses, as well as to interpret the results.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="7.5">Goal 5: Find and Follow Relevant Design Decisions</head><p>When writing new code, developers need to make sure that it is consistent with existing design decisions. To do so, developers must find and follow the design decisions that have already been made. Failing to find or follow design decisions may lead to developer confusion, decreased com-Fig. <ref type="figure">14</ref>. In ActiveDocumentation <ref type="bibr">[104]</ref> developers can find relevant design rules using the labels assigned to each design rule and the filtration feature that displays related design rules for each class.</p><p>prehensibility of code, and code decay <ref type="bibr">[48,</ref><ref type="bibr">95]</ref> as well as defects. New design decisions may diverge from the original design (architectural drift) or violate the intended architecture (software erosion) <ref type="bibr">[60,</ref><ref type="bibr">61,</ref><ref type="bibr">146,</ref><ref type="bibr">155]</ref>.</p><p>Tools may offer support to developers in finding and following design decisions. If documented (Section 5), then tools may support developers in identifying and following relevant documented design decisions. If uncaptured, then tools may help developers find and follow decisions by helping to extract decisions from code.</p><p>7.5.1 Documentation Tools. Developers can find documented design decisions using search features in IDEs or documentation tools. Documentation tools store design rules in specially designed data stores <ref type="bibr">[41]</ref> or JSON files <ref type="bibr">[104]</ref>. Design rules can be looked up based on properties such as their description, scope, or rationale. Documented decisions in comments may be looked up through IDE search features or other suitable IDE plugins. For instance, CODES <ref type="bibr">[150]</ref> generates JavaDoc for specifications and descriptions of methods inserted in code, which can be looked up by the same tools used for searching the code. Documentation tools use a variety of approaches to help developers retrieve relevant design rules, such as through search or by organizing rules. Developers may search for target design decisions through keyword queries. Other tools organize decisions to expedite search. For example, in ActiveDocumentation <ref type="bibr">[104]</ref> developers can define labels based on topics applied in code and mark design rules with relevant labels. The labels and related design rules are accessible in the tool by clicking on the tags (Figure <ref type="figure">14</ref>). Many documentation tools connect design decisions to code to enrich documentation. Maintaining a bidirectional connection between design rules and code helps developers find relevant design rules more easily (Figure <ref type="figure">14</ref>). 7.5.2 Static Analysis Tools. By connecting design rules to code, static analysis tools enable developers to identify design rules simply by writing code and then running the static analysis tool to check if any design rules have been violated (e.g., PMD <ref type="bibr">[41]</ref>, FindBugs <ref type="bibr">[69]</ref>, CheckStyle <ref type="bibr">[2]</ref>). After flagging a design rule violation, some tools also provide additional information about how to follow the design rule. For example, ActiveDocumentation <ref type="bibr">[104]</ref> lists code snippets that follow design rules, which developers may then use as an example of how to follow the design rule. 7.5.3 Design Rationale Tools. Design rationale tools capture decisions in structured formats (model-based tools) or mark relevant information in non-code artifacts (artifact-based tools). Like documentation tools, model-based design rationale tools provide features for easier retrieval of design decisions. The structure may assist developers in finding design decisions. In addition, most tools include search or browse features to find design decisions through keywords or by intent. Some also connect rationale to code <ref type="bibr">[29]</ref>, which may support understanding how and where rules should be followed in code. For instance, using SEURAT <ref type="bibr">[29]</ref>, developers can find design decisions relevant to a code snippet by following links developers created when documenting design rationale.</p><p>7.5.4 Design Pattern Catalog Tools. Design pattern catalog tools use a structured representation to collect and categorize design patterns based on properties such as characteristics, jurisdictions, intents, or the problems they solve (Section 5.4). Many design pattern catalog tools allow developers to search for design patterns based on their properties and apply them to their code by following their constraints. Conversely, developers can look up design patterns applied to their code in design pattern catalog tools using the identifiers used in the code. However, mapping applied patterns to catalogs may be challenging, due to a potential for vocabulary mismatch between the terminology in catalogs and terminology used in a project. To address this, some catalog tools may be customized per-project or explicitly link between catalogs and pattern instances in code. For example, in SEURAT_Architecture <ref type="bibr">[154]</ref>, developers can document information of patterns applied in code and link the patterns to the documentation. 7.5.5 System Architecture Tools. As discussed in Section 7.3.4, design rules on system dependencies may be formulated as constraints over system elements. Developers may study these to understand architectural design decisions. After editing the code, these tools may also help developers uncover design rules by flagging new violations of architectural design rules that have been introduced.</p><p>7.5.6 Reverse Engineering Tools. Reverse engineering tools may help developer uncover hidden design rules by helping them extract them from code. Most reverse engineering tools detect repeated code fragments in code according to some predefined frequency threshold and present them to a developer (e.g., Reference <ref type="bibr">[153]</ref>). The developer then evaluates the results and may find implicit design rules in code. For example, code clone detectors may identify a particular method call chain for persisting data using API methods in a controller package, which is a design rule imposed by the API constraining the method call chains for persisting data. By examining these results, developers may learn about the design rule and the appropriate location in the codebase for invoking persistence functionality (i.e., the controller package). 7.5.7 Software Query Languages and Tools. Software Query Languages and Tools may be used to find a design rule and, to some extent, understand how to follow it. Software query languages and tools enable developers to query the codebase to find design rules. For example, developers can query for calls to a specific API method to find design rules related to it. This requires developer to interpret and make sense of these results to uncover hidden implicit design rules. 7.5.8 Challenges. To find and follow relevant design decisions, developers can look to identify relevant decisions that have been documented through a tool. However, this imposes several challenges on developers. One key barrier is maintaining documented design decisions. As discussed in Section 7.3.5, outdated and incomplete documentation misinforms developers, leading to software drift and erosion. Some tools like ActiveDocumentation <ref type="bibr">[104]</ref> alleviate this issue by constantly checking rules against code and providing instant feedback. Another related challenge is the quality and comprehensibility of documented design decisions. To follow design decisions, developers first need to understand the decisions, their rationale, their constraints, and their implementation. Unclear descriptions may confuse developers, who may then fail to follow the decisions. Another obstacle in using tools is motivating developers to adopt and use the tools to find and follow design decisions. Despite being useful <ref type="bibr">[12]</ref>, many developers refrain from using tools for non-development tasks such as finding and following design decisions. For instance, studies of the usability of static analysis tools suggest that developers have several concerns, including the presentation of the results, the accuracy of the results (numerous warnings and high rates of false positives), inadequate information and examples for fixing violations, and separate workflows for software development and using the tools <ref type="bibr">[38,</ref><ref type="bibr">73,</ref><ref type="bibr">128]</ref>. Some approaches mitigate these barriers, such as by supporting tool customization, more structured and detailed presentations of information, and automating usage of a tool at required development steps, such as Code Review <ref type="bibr">[73,</ref><ref type="bibr">128]</ref>.</p><p>In addition to these challenges, using design pattern catalog tools have to find and follow design decisions imposes additional difficulties. To find relevant design patterns, developers need to map identifiers in code consistent with the ones used in the catalogs. However, this does not always occur (Section 7.3.5), forcing developers to manually map identifiers, which is challenging.</p><p>Like design pattern catalog tools, system architecture tools require developers to interpret the models and map them to the source code. Model-based system architecture tools-reflexion models and dependency-structure matrices-represent the high-level structure of the codebase through diagrams and matrices. Therefore, if the tools lack enough support in mapping the elements, then corresponding high-level elements in the diagrams to lower-level code elements can be difficult for developers. Some tools like Lattix <ref type="bibr">[5]</ref> address this issue by visualizing the structure in a hierarchical presentation that can be expanded to show lower-level elements.</p><p>Using reverse engineering tools and software query languages and tools to find and follow design decisions depends on the efficiency and accuracy of the algorithms used to extract design decisions and the ability of developers to interpret and analyze the results. Reverse engineering tools and software query languages and tools potentially suffer from false positives (incorrectly detected patterns and rules). Some tools support manual or automatic techniques to address this issue. For example, Rasool et al. <ref type="bibr">[121]</ref> used annotations for better retrieval of design patterns in code. However, it still relies on developers to maintain the annotations. Dong et al. <ref type="bibr">[44]</ref> used behavioral and semantic analysis to eliminate falsely detected candidate design patterns. Another challenge is the reliance on developers to interpret and analyze the results. Tools require developers to examine potential design decisions to differentiate accidental patterns from intended design decisions. Therefore, the form of the presentation of extracted information is key.</p><p>Takeaways. When modifying code, developers must find and follow previously made design decisions, which may be supported through tools. Documentation tools, design rationale tools, design pattern catalog tools, and system architecture tools provide access to previously captured design decisions. These tools may also link documentation to code or check the code against the decisions. By utilizing these tools, developers may be offered a process to both find a decision as well as information about how to follow it. Additionally, after a decision has already been identified, reverse engineering tools and software query languages may assist in the process of writing new code consistent with a design decision by identifying previously written code that is consistent with a design decision.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="7.6">Goal 6: Determine why an Alternative Was Selected</head><p>Developers look to explain why an alternative was selected (its rationale) when they wish to reevaluate or change a decision and understand the impact of these changes <ref type="bibr">[25,</ref><ref type="bibr">29,</ref><ref type="bibr">82]</ref>. Developers report that answering questions about rationale is one of their most frequent hard-to-answer questions about code <ref type="bibr">[83]</ref> and one of the most serious problems they face <ref type="bibr">[84]</ref>. Tools have been designed to support developers in answering these questions by capturing rationale information in free form text or structured models, sometimes in association with design rules. 7.6.1 Documentation Tools. Documentation tools capture information about design decisions, including design rationale, in model-free representations as text. In code-based documentation tools like ActiveDocumentation <ref type="bibr">[104]</ref>, documented design rules may include a field for a description, which may be used to capture design rationale. In on-demand documentation tools like CODES <ref type="bibr">[150]</ref>, design rationale information is extracted from non-code artifacts such as Stack Overflow discussions. 7.6.2 Static Analysis Tools. Associated with the design rule checked by static analysis tool may be design rationale that can be used to reason about design decisions. Design rationale may be captured in tools such as PMD <ref type="bibr">[41]</ref> and FindBugs <ref type="bibr">[69]</ref> and accessed in data stores as well as the IDE views of the tools when the design decision is violated. 7.6.3 Design Rationale Tools. Design rationale tools directly focus on documenting design rationale by recording alternatives, arguments, and other information that may enable reasoning about rationale (Section 4). Using a diagramatic or tree view of rationale, developers may reason about what alternatives were considered and why specific ones were chosen. The information recorded in artifact-based tools may not be as detailed as model-based tools, as these tools do not enforce or check that specific information has been recorded. To find captured rationale for a code snippet, developers can query or browse the documented rationale. Tools may also connect design rationale directly to code (e.g., SEURAT <ref type="bibr">[29]</ref>). 7.6.4 Design Pattern Catalog Tools. Design pattern catalog tools often use design rationale information to describe the intent of a design pattern, describing the motivation of a design pattern, its consequences, and its rationale <ref type="bibr">[58]</ref>. For example, developers may explore the reasoning behind or the consequences of selecting a design pattern in SEURAT_Architecture <ref type="bibr">[154]</ref> or look for the intent of a design pattern in DRIMER <ref type="bibr">[116]</ref>. 7.6.5 System Architecture Tools. System architecture tools may also support adding rationale to explain rules. For example, Structure101 <ref type="bibr">[4]</ref> enables developers to add descriptions or rationale for patterns, constraints, or architectural elements in a free-form textual field (Figure <ref type="figure">15</ref>). 7.6.6 Challenges. Tools that rely on developers to document design rationale ultimately rely on developers to first do this. Documenting rationale is considered overhead by many developers <ref type="bibr">[51]</ref>, and it is often easy for developers to ignore <ref type="bibr">[142]</ref>. Moreover, in most documentation tools, static analysis tools, and system architecture tools, the information created takes the form of free-form text. This flexibility may enable developers to neglect documenting rationale, may make it harder to understand, and may leave it incomplete. The language used in describing rationale may also be hard to understand. As software evolves, vocabulary may change and the initial vocabulary used to author the rationale may become dated. Design rationale may also be out of date. Most design rationale tools are stand-alone tools, separated from the code, or provide only one-way links to code snippets without checking the code or maintaining the links. Developers are responsible for updating documented rationale when the code changes, but this may be challenging. Takeaways. Tools can assist developers in understanding the rationale behind choosing an alternative design. Documentation tools, design rationale tools, design pattern catalog tools, static analysis tools, and system architecture tools can capture information on design decisions, including the reasoning them. When it exists and is up to date, developers may leverage this information to better comprehend the reasoning behind design decisions.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="8">FUTURE RESEARCH DIRECTIONS</head><p>In this article, we surveyed seven types of tools that help developers work with design decisions and six goals developers try to achieve during software development. This survey evaluated how different types of tools can be employed to achieve each goal and examined the challenges developers face when using the tools to achieve these goals. While addressing the challenges discussed in Section 6 paves the way for many future improvements, a number of broader questions and areas of research remain for exploration, which we also survey in the following.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="8.1">Better Support for Documentation</head><p>One of the main mechanisms by which tools have been envisioned to assist developers is by facilitating the process of working with captured design decisions. Documentation, static analysis, and design rationale tools all rely on information to be first captured about a design decision at the point in time when a developer makes a decision. However, this approach brings several challenges, as discussed in this survey.</p><p>First, developers may not be motivated to document alternatives and design decisions explicitly through tools, as this requires the developer to spend time doing more work. To give developers more payoff for investing the time needed to create this content in documents, tools should be carefully designed to incentivize developers to do this work. One key challenge is that tools today ask developers to do work-write documentation-but only give benefits later-when developers revisit this documentation in the future to make future changes that are consistent. One way to address this is to create tools that, while creating documentation, also support the developer at the point in time when they are making the design decision and doing the work to write the documentation. For example, when a developer uses ActiveDocumentation <ref type="bibr">[104]</ref> to document a design decision that they are currently making, the tool will immediately give them feedback about all of the points in the code that either follow or violate this design decision. This may be useful for the developer as they make the design decision in helping to identify code that they had not realized needs to be updated and in reducing the investigation they may need to do to find all of the implications of the design decision they had just made.</p><p>Second, documenting checkable design rules in tools such as static analysis tools often requires specialized program analysis knowledge or complex query notations. In practice, developers are unlikely to have this knowledge and may not be motivated to invest the time necessary to learn it. As a result, these tools today are rarely used in practice to document project-specific design rules. Even for developers that have the knowledge necessary to use these tools, existing tools and notations can make writing design decisions down in the necessary format time-consuming, further reducing developers' motivation to document decisions. Tools can play an important role in addressing this barrier. Instead of requiring specialized knowledge, tools can instead use concepts with which developers are already familiar and provide dedicated tool support not just for checking design rules but also the process of creating and authoring design rules. For example, RulePad <ref type="bibr">[105]</ref> addresses these issues by using a semi-natural language in which to author design rules and offering a dedicated editor for crafting design rules.</p><p>Third, documentation must be regularly maintained and updated to remain useful and not become outdated. Offering support for updating documentation throughout the life of a software project is at least as important as supporting initial creation of documentation. One way tools may assist developers is by identifying cases where the documentation and code have diverged over time and notifying the developer that these divergences have been created. Particularly if this can be identified at the point in time in which design decisions are first violated (e.g., when a developer writes new code), then it may be faster and easier for the developer to rapidly revise the design decision to reflect their new intent as they are creating a new design decision.</p><p>Fourth, tools should be able to capture various types of information, including design rationale. While many existing tools provide free-form text to document information about design decisions, this approach can lead to important information being inadvertently left out. To overcome this issue, tools can use templates that require specific types of information to be recorded for every decision. Additionally, tools can support information management by linking together related design decisions. For instance, in design rationale tools like SEURAT <ref type="bibr">[29]</ref>, developers can link related alternatives, arguments, and chosen alternatives to help keep track of the decision-making process. This may aid in faster and more effective searches.</p><p>Fifth, it is essential for tools to support linking design decisions to code to ensure that developers can follow the intended design. By enabling easy access to the relevant documentation to understand the reasoning behind the decisions made during the design phase, developers may make more informed decisions when modifying code. Moreover, linked documentation is easier to update than disconnected documentation. Changes made to the code can be immediately reflected in the documentation, ensuring that the documentation is always up-to-date <ref type="bibr">[104]</ref>.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="8.2">Better Support for Reverse Engineering</head><p>Tools can also assist developers with design decisions by extracting information from code. Reverse engineering tools and software query languages and tools can help find patterns and query codebases, which can aid in finding alternatives in code, checking hypothesized decisions, and discovering design decisions in code. However, as we discussed in this survey, the results produced by these tools often contain false positives and require interpretation, which can be time-consuming and challenging for developers. To overcome these challenges, tools should offer more effective techniques and present results in a way that is tailored to developers' work context, making them easier to understand and apply. For example, tools can prune results only related to the recent activities of developers <ref type="bibr">[74]</ref>. Another challenge is that using software query languages and tools requires specialized knowledge to write queries. To address this, tools can provide an intermediate interface or language for writing queries that does not require additional training. For example, using semi-natural to write queries can be helpful for novice developers in greatly reducing the necessary training <ref type="bibr">[105]</ref>.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="8.3">Connecting Software Tools</head><p>One of the challenges in using developer tools is that they are often disconnected from other tools. To achieve their goals, developers must often use multiple tools, which reduces their productivity. Existing tools offer only full support to developers in achieving one or two goals and only partial support in achieving other goals. For example, ActiveDocumentation <ref type="bibr">[104]</ref> directly supports developers in documenting and following design decisions but offers only partial support in reasoning about design decisions. As a result, developers may need to rely on separate tools, such as specialized tools like SEURAT <ref type="bibr">[29]</ref> for reasoning about rationale. As these two tools are disconnected, using them together today would require the developer to document each design decision twice, once in the format for each tool. Offering tools that support a broader range of goals, or at least more integration information sharing between tools, might help increase the benefits of using tools while dramatically reducing the costs.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="8.4">Return on Documentation Investment</head><p>To better tailor tools to meeting developers' goals, further research is needed to better understand the information needed in achieving developer goals. Developers constantly make choices about what to document and how much detail to include in documenting it. To the extent that developers document information that is obvious or fail to document what is not obvious, these choices may cause issues later. Documented information may help developers achieve later goals, but it comes at the cost of the time that must be invested to document it, which developers often find demotivating. Developers may question to what extent all of this documentation is truly worth the effort required, as modern processes such as agile development often eschew it.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="8.5">Documenting vs. Reverse Engineering</head><p>There are two main approaches to working with design decisions: explicitly documenting decisions and reverse engineering tacit decisions from software artifacts. Traditionally, developers have been encouraged to write and maintain documentation. But a more recent emphasis has been on tools that support developers in extracting tacit decisions from artifacts. Reverse engineering tools extract information from software artifacts through mining <ref type="bibr">[11,</ref><ref type="bibr">94,</ref><ref type="bibr">97,</ref><ref type="bibr">125]</ref> and querying <ref type="bibr">[75]</ref> software artifacts. The advantages of using reverse engineering tools to retrieve design decisions are that developers need only work with the tools at the point of need, when they are trying to understand decisions, rather than invest upfront in documentation effort and the maintenance required to maintain this documentation.</p><p>But, as discussed in this survey, one key challenge in using mining tools is their heavy reliance on developers to infer decisions from extracted patterns. One may argue that this process is inherently unreliable, and developers should not solely rely on these tools to discover decisions. Better understanding how this tradeoff works in practice is an important area for future research.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="8.6">Usability Issues</head><p>Despite their potential usefulness, many tools remain underused due to usability issues. As described in this survey, issues such as poor reliability, hard-to-understand results, and disconnected tools demotivate developers from using tools. Several studies have examined the usability issues involved with using static analysis tools (e.g., References <ref type="bibr">[38,</ref><ref type="bibr">73]</ref>) and proposed suggestions to mitigate common issues, such as configuring the priority of errors based on development contexts (e.g., local programming, continuous integration, or code review) <ref type="bibr">[152]</ref>, more structured error messages <ref type="bibr">[14]</ref>, supporting collaborative environments <ref type="bibr">[112]</ref>, and offering immediate feedback <ref type="bibr">[144]</ref>. But important research remains to more broadly understand the usability issues across the full range of tools for working with design decisions in code.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="9">CONCLUSION</head><p>Design decisions are central to software, directly determining its correctness, comprehensibility, and maintainability. Design decisions progress through a lifecycle during software development; they may be captured by developers when decisions are made or remain uncaptured. There are many open areas for future work, including better motivating developers to document decisions, supporting the process of documenting decisions as well as updating documentation, offering more information when reverse engineering decisions, improving the usability of tools, and improving the integration between tools that support different developer goals. In addition, further research is needed to better understand exactly what information developers require when achieving their goals, to help refine the information documentation tools ask developers to record as well as the presentation of information that might be reverse engineered. More broadly, important questions remain about if and when it is necessary for developers to take the time to document decisions or the extent to which reverse engineering tools can provide many of the same benefits.</p></div><note xmlns="http://www.tei-c.org/ns/1.0" place="foot" xml:id="foot_0"><p>ACM Computing Surveys, Vol. 56, No. 2, Article 37. Publication date: September 2023.</p></note>
			<note xmlns="http://www.tei-c.org/ns/1.0" place="foot" n="1" xml:id="foot_1"><p>https://developer.mozilla.org/en-US/docs/Web/XPath.</p></note>
		</body>
		</text>
</TEI>
