{"id":93,"date":"2022-03-09T15:21:31","date_gmt":"2022-03-09T14:21:31","guid":{"rendered":"https:\/\/www.koenmannaerts.com\/?p=93"},"modified":"2022-03-09T15:21:33","modified_gmt":"2022-03-09T14:21:33","slug":"analyzing-code-bases","status":"publish","type":"post","link":"https:\/\/www.koenmannaerts.com\/?p=93","title":{"rendered":"Analyzing Code Bases"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\">Trace the behavior<\/h2>\n\n\n\n<p>The first thing I do when analyzing software is to trace a certain behavior, that I know the software supports, throughout the codebase. Eg:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Create a contract<\/li><li>Create a new user<\/li><li>Terminate a contract<\/li><\/ul>\n\n\n\n<p>It strikes me time and time again that this at first glance simple analysis is in most code bases very very difficult. For instance, creating a new contract is not just that, it looks more like:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Create a draft contract<\/li><li>Review and adjust that contract<\/li><li>Send a notification to the customer<\/li><li>Keep on eye on the expiration date of the draft<\/li><li>Capture signatures<\/li><li>Turn the draft contract into a real contract<\/li><li>Start the contracted services<\/li><\/ul>\n\n\n\n<p>So it looks more like a chain of operations separated in time, we call it a workflow or a business process. <\/p>\n\n\n\n<h2 class=\"wp-block-heading\">The chase<\/h2>\n\n\n\n<p>So I set off to &#8220;chase&#8221; this series of actions throughout the codebase. Starting with the customer clicking a button and which leads to the invocation of a method on controller X and going deeper down into the codebase. What I expect to see is the sequence of steps described above: the <strong>contract<\/strong> workflow. At least in some form or another. <\/p>\n\n\n\n<p>What I most often see is the method on the controller flipping some flag on a <strong>contract<\/strong> entity and that&#8217;s it&#8230; Mmm where is the workflow, what is the next step? Who will pick up after this first action? It could be a worker thread is scanning the <strong>contract<\/strong> entities and picks up this contract or it could appear on a UI screen based on a query which thereby trigger the user to do something with it.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Why?<\/h2>\n\n\n\n<p>Why can&#8217;t I just see the workflow popping out of the code? Isn&#8217;t automating a certain workflow \/ a certain behavior what a software system is supposed to do? I advise all software architects and developers to do this exercise and assess how easy they can do this tracing.<\/p>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Trace the behavior The first thing I do when analyzing software is to trace a certain behavior, that I know the software supports, throughout the&#8230;<\/p>\n<div class=\"more-link-wrapper\"><a class=\"more-link\" href=\"https:\/\/www.koenmannaerts.com\/?p=93\">Continue reading<span class=\"screen-reader-text\">Analyzing Code Bases<\/span><\/a><\/div>\n","protected":false},"author":1,"featured_media":95,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"spay_email":"","footnotes":""},"categories":[1],"tags":[4],"class_list":["post-93","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-uncategorized","tag-systemdesign","entry"],"jetpack_featured_media_url":"https:\/\/www.koenmannaerts.com\/wp-content\/uploads\/2022\/03\/Find-all-references.png","_links":{"self":[{"href":"https:\/\/www.koenmannaerts.com\/index.php?rest_route=\/wp\/v2\/posts\/93","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.koenmannaerts.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.koenmannaerts.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.koenmannaerts.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.koenmannaerts.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=93"}],"version-history":[{"count":2,"href":"https:\/\/www.koenmannaerts.com\/index.php?rest_route=\/wp\/v2\/posts\/93\/revisions"}],"predecessor-version":[{"id":96,"href":"https:\/\/www.koenmannaerts.com\/index.php?rest_route=\/wp\/v2\/posts\/93\/revisions\/96"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.koenmannaerts.com\/index.php?rest_route=\/wp\/v2\/media\/95"}],"wp:attachment":[{"href":"https:\/\/www.koenmannaerts.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=93"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.koenmannaerts.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=93"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.koenmannaerts.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=93"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}