<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Ranuga Disansa on Medium]]></title>
        <description><![CDATA[Stories by Ranuga Disansa on Medium]]></description>
        <link>https://medium.com/@Programmer-RD-AI?source=rss-856efb321f48------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*X0OK03NWMQZxwxdcCxF7PA.png</url>
            <title>Stories by Ranuga Disansa on Medium</title>
            <link>https://medium.com/@Programmer-RD-AI?source=rss-856efb321f48------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 18 Nov 2026 16:13:23 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@Programmer-RD-AI/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Throw Away Idea: Concrete Integrity Assessment with Hyperspectral Imaging and Deep Learning]]></title>
            <link>https://medium.com/@Programmer-RD-AI/throw-away-idea-concrete-integrity-assessment-with-hyperspectral-imaging-and-deep-learning-51f6d9e6739c?source=rss-856efb321f48------2</link>
            <guid isPermaLink="false">https://medium.com/p/51f6d9e6739c</guid>
            <category><![CDATA[deep-learning]]></category>
            <category><![CDATA[hyperspectral-imaging]]></category>
            <category><![CDATA[civil-engineering]]></category>
            <category><![CDATA[ideas]]></category>
            <dc:creator><![CDATA[Ranuga Disansa]]></dc:creator>
            <pubDate>Sun, 16 Aug 2026 13:47:50 GMT</pubDate>
            <atom:updated>2026-08-16T13:47:50.309Z</atom:updated>
            <content:encoded><![CDATA[<h3>The Problem</h3><p>Bridges, tunnels, dams, buildings we inspect them every 5 to 10 years, because a proper assessment costs time, money, and a specialist who knows what they’re looking at. The trouble is that concrete doesn’t fail on that schedule. Carbonation, chloride ingress, moisture creeping through the pore structure all of it happens quietly, inside the material, for years before anything shows up on the surface. By the time an inspector can see a problem, the problem is old.</p><h3>The Core Idea</h3><p>Concrete in different states of degradation reflects light differently. Not in ways your eye picks up, but across hundreds of narrow wavelength bands, carbonated concrete and sound concrete and moisture-saturated concrete each leave a different spectral fingerprint.</p><p>So point a hyperspectral camera at it. Train a network on those spectral signatures, learning directly from the spectra rather than needing someone to core-sample and label every structure. Output two numbers: an integrity score from 0 to 100, and a confidence value from 0 to 1 that says how much to trust it.</p><p>Then make it explain itself. Run SHAP over the predictions to find which wavelengths drove the score. Now instead of “this wall is a 62,” you get “this wall is a 62, and here are the bands that pushed it there.” An engineer can argue with that. They can’t argue with a black box.</p><h3>Why It Matters</h3><p>Inspection stops being an event and starts being a measurement. It’s fast, it’s non-contact, it’s repeatable, and it doesn’t depend on whose eyes are on the wall that day. You catch degradation while it’s still cheap to fix, and you get a number you can actually defend when you ask for the maintenance budget.</p><p>That’s it. Spectral fingerprints, a network to read them, and SHAP so it shows its work.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=51f6d9e6739c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How AWS Nitro Enclaves Attestation Actually Works]]></title>
            <link>https://medium.com/@Programmer-RD-AI/how-aws-nitro-enclaves-attestation-actually-works-b6361a9722ff?source=rss-856efb321f48------2</link>
            <guid isPermaLink="false">https://medium.com/p/b6361a9722ff</guid>
            <category><![CDATA[confidential-computing]]></category>
            <category><![CDATA[nitroenclaves]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[golang]]></category>
            <category><![CDATA[cloud-security]]></category>
            <dc:creator><![CDATA[Ranuga Disansa]]></dc:creator>
            <pubDate>Wed, 27 May 2026 10:39:34 GMT</pubDate>
            <atom:updated>2026-05-27T10:39:34.862Z</atom:updated>
            <content:encoded><![CDATA[<p>I came across the concept of “Nitro Enclaves” while reading through the AWS documentation, and I had genuinely never heard of it before. This article is my attempt to properly understand how Nitro Enclaves and their attestation mechanism actually work.</p><p>But why would you want this in the first place? The whole point is being able to prove that the code running in the cloud is exactly what you expect it to be (untampered, running in the specific environment you intend), so that the other party (a client, a service such as KMS, or anything else) can trust it enough to hand over secrets. That is the problem Nitro Enclaves and attestation are solving: establishing trust without simply having to take the server’s word for it.</p><p>The full reference implementation for everything described here is available on GitHub: <a href="https://github.com/prdai/aws-nitro-attestation-verifier">https://github.com/prdai/aws-nitro-attestation-verifier</a></p><p>At a high level, this is a re-implementation of a fairly normal workflow. A client sends a request to an EC2 instance. Inside that EC2 instance lives a private virtual machine, the Nitro Enclave. The EC2 instance and the enclave communicate over vsock (a Linux kernel communication mechanism that requires no network connectivity). The enclave calls an internal component, the Nitro Security Module (NSM), to obtain an attestation document, which is returned back through the EC2 instance to the client. The client can then verify the document and check that the PCR values (which describe the environment and instance that is running) match what it expects.</p><p>The depth of each section below varies depending on how far I went into each topic. This is as much about how I approach learning these things as it is a complete reference.</p><h3>The Big Picture</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Bqrcl8ddjIGkQKsqY0oSRg.png" /></figure><p>Put simply: a client calls an EC2 instance, which calls an internal virtualised container that returns a document, and that document is passed back. There is not much to discuss from an architectural standpoint. It is about as simple as it gets.</p><p>The unfamiliar pieces you keep running into throughout this are vsock, CBOR, and COSE. Let’s get those out of the way first, and then walk through the actual steps.</p><h3>Background</h3><h4>vsock</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/337/1*Pn9HChreRcVEVqkJ97ktLg.png" /><figcaption><a href="https://medium.com/@F.DL/understanding-vsock-684016cf0eb0">https://medium.com/@F.DL/understanding-vsock-684016cf0eb0</a></figcaption></figure><p>That arrow between the server and the Nitro Enclave in the diagram above (the one labelled vsock) is what this section is about.</p><p>vsock, or VM sockets, is a form of communication that operates at the kernel level without requiring any networking infrastructure. It is primarily used for communication between virtual machines and hypervisors, or in situations like this one, between an EC2 instance and a Nitro Enclave.</p><p>There is considerably more to vsock than I initially expected, and I have likely glossed over some of the lower-level implementation details, so I would recommend reading further on your own as well.</p><p>vsock is a protocol similar to TCP/UDP or Unix sockets. The entire purpose is to allow communication between virtual machines without any network configuration. To build this up from scratch: we have a parent instance, a hypervisor, and the VMs themselves. Each of these has a CID and a port, which act as the unique identifiers for the different VMs and hypervisors. The CID is simply a unique integer used for identification: literally a single integer such as 0, 1, 2, and so on. A few values are reserved, but you could, for example, run a Nitro Enclave on CID 16 at port 5000 if you wanted to. It is about as straightforward as it sounds.</p><p>For transmission, we use the same general socket interface that the kernel uses for all socket implementations, whether that is reading a file or opening a TCP/UDP connection:</p><pre>int fd = socket(AF_VSOCK, SOCK_STREAM, 0);</pre><p>When we then call connect() on this file descriptor, the kernel-level implementation of vsock hands the payload over to the virtio-vsock/vhost-vsock drivers, which form the actual transport layer. The following is an example of a vsock packet (for virtio):</p><pre>struct virtio_vsock_packet {   <br>    struct virtio_vsock_hdr hdr;   <br>    u8 data[];   <br>};</pre><pre>struct virtio_vsock_hdr {<br>    le64 src_cid;    // Sender CID<br>    le64 dst_cid;    // Receiver CID<br>    le32 src_port;   // Sender port<br>    le32 dst_port;   // Receiver port<br>    le32 len;        // Payload size<br>    le16 type;       // Socket type<br>    le16 op;         // Packet operation<br>    le32 flags;      // Control flags<br>    le32 buf_alloc;  // RX buffer size<br>    le32 fwd_cnt;    // Bytes consumed<br>};</pre><p>Once this packet is sent through the hypervisor into the VM and on to the specific application, the response returns to us in the same manner, as a similar packet.</p><p>There is a great deal of kernel-level communication happening between transmissions. To learn more, see: <a href="https://man7.org/linux/man-pages/man7/vsock.7.html">https://man7.org/linux/man-pages/man7/vsock.7.html</a></p><h4>CBOR (Concise Binary Object Representation)</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5MWy6dYwXsD-CJWXt3U4zg.png" /><figcaption><a href="https://devblogs.microsoft.com/odata/enable-cbor-within-asp-net-core-odata/">https://devblogs.microsoft.com/odata/enable-cbor-within-asp-net-core-odata/</a></figcaption></figure><p>In short, CBOR is a binary data serialisation method. It is well suited to transporting binary data (such as an attestation document) in a small, compact form.</p><p>As a brief overview: CBOR is a schema-optional format, which means it requires more runtime validation, but it strikes a good balance among the available serialisation methods. For a comparison of CBOR against the alternatives, see: <a href="https://cborbook.com/introduction/cbor_vs_the_other_guys.html">https://cborbook.com/introduction/cbor_vs_the_other_guys.html</a></p><h4>COSE (CBOR Object Signing and Encryption)</h4><p>COSE is, as the name suggests, a cryptographic signing standard.</p><p>COSE comes in a few different variations, and the one we are using here is _Sign1. It essentially means we have exactly one of everything: one payload, one signature, and one signer (unlike COSE_Sign, for example, which supports multiple signers).</p><p>COSE can also handle encryption, but here we are only using the signing portion of it.</p><pre>[<br>  protected:   Header,<br>  unprotected: Header,<br>  payload:     This field contains the serialized content to be signed,<br>  signature:   This field contains the computed signature value.<br>]</pre><pre>18(/* COSE_Sign1 CBOR tag is 18 */<br>    {1: -35}, /* This is equivalent with {algorithm: ECDS 384} */<br>    {}, /* We have nothing in unprotected */<br>    $ATTESTATION_DOCUMENT_CONTENT /* Attestation Document */,<br>    signature /* This is the signature */<br>)</pre><p>We will see this structure taken apart again in the client verification section.</p><h3>The Workflow</h3><h4>Getting the Attestation Document (Nitro Enclave)</h4><p>On the enclave side, the enclave sits and listens on a vsock port, waiting. The server on the EC2 side connects over that vsock (again, the arrow from the diagram), and the incoming request carries a nonce: a random, one-off value from the client that proves the request is fresh and not a replay of an older one. That nonce is really the key detail we take off the wire here.</p><p>The convenient part is that we do not have to build the attestation document ourselves. There is already a Go NSM (Nitro Security Module) SDK that wraps all of this (<a href="https://github.com/cyclicalvc/nitro-enclaves-sdk">https://github.com/cyclicalvc/nitro-enclaves-sdk</a>), so we simply rely on it. We hand it the nonce, it does its work, and it returns the attestation document. There really is not much more to it on our end. The shape of what we get back is defined in CDDL:</p><pre>AttestationDocument = {<br>    module_id: text,               ; issuing Nitro hypervisor module ID<br>    timestamp: uint .size 8,       ; UTC time when document was created, in<br>                                   ; milliseconds since UNIX epoch<br>    digest: digest,                ; the digest function used for calculating the<br>                                   ; register values<br>    pcrs: { + index =&gt; pcr },      ; map of all locked PCRs at the moment the<br>                                   ; attestation document was generated<br>    certificate: cert,             ; the public key certificate for the public key <br>                                   ; that was used to sign the attestation document<br>    cabundle: [* cert],            ; issuing CA bundle for infrastructure certificate<br>    ? public_key: user_data,       ; an optional DER-encoded key the attestation<br>                                   ; consumer can use to encrypt data with<br>    ? user_data: user_data,        ; additional signed user data, defined by protocol<br>    ? nonce: user_data,            ; an optional cryptographic nonce provided by the<br>                                   ; attestation consumer as a proof of authenticity<br>}<br><br>cert = bytes .size (1..1024)       ; DER encoded certificate<br>user_data = bytes .size (0..1024)<br>pcr = bytes .size (32/48/64)       ; PCR content<br>index = 0..31<br>digest = &quot;SHA384&quot;</pre><p>A couple of things worth pointing out: the pcrs field holds the PCR values mentioned at the start, and the certificate and cabundle are what we end up checking later, in the client verification section. The nonce field is the same nonce we passed in, embedded back into the document so the client can confirm its authenticity.</p><p>And that is essentially all there is to this side: we take the document and send it straight back over the same vsock connection to the EC2 server, which passes it along to the client.</p><h4>The Middle Man (EC2)</h4><p>The EC2 instance is essentially just a public server. It accepts HTTP requests, and nothing more elaborate than that.</p><p>When we hit the relevant endpoint, the server establishes a vsock connection down to the enclave (again, the arrow from the diagram) and requests a document from it. The enclave performs its NSM work from the previous section and hands the document back over vsock.</p><p>Once we have it, we base64-encode it and place it into the response:</p><pre>AttestationDocument: base64.StdEncoding.EncodeToString(rawDoc),</pre><p>We then return it to the client when its request completes. The EC2 server is therefore just a proxy in the middle: it never opens the document or verifies anything. It simply relays the nonce down and the document back up.</p><h4>Verifying the Attestation Document (Client)</h4><p>The client here is nothing special; you can think of it as KMS, as a standalone verifier, or as whatever you like. In our case it is a very basic standalone verifier. All it does is send the request and receive the data back.</p><p>Once we have the data, we take the attestation document, which is COSE_Sign1 encoded, and decode it. Its payload is CBOR, so we deserialise that to recover the document, which carries a signing certificate along with its CA bundle. We then validate that certificate chain up to the AWS Nitro Enclaves root certificate that AWS publishes; this is the step that actually establishes trust. With the chain verified, we take the public key out of that certificate and use it to check the COSE_Sign1 signature. That is essentially how we confirm the document is genuine and that it really came from a Nitro Enclave.</p><p>From here, we do not do anything specific with it, but this is exactly the point at which you would. For instance, you could check the PCR values to confirm that the enclave environment is the specific one you intended (the right image, the right code running, and so on), and build whatever you need on top of that established trust.</p><h3>Running It</h3><p>In terms of actually getting this running for development, the general flow starts with Terraform. We use Terraform to set up all the infrastructure: the EC2 instance, its public exposure, and everything else that goes with it.</p><p>Once that is up, we SSH into the EC2 instance, start the EC2 server, then build the Nitro Enclave and bring it up. At that point the entire flow described above is live, and you can hit it from the client.</p><h3>References</h3><ul><li><a href="https://github.com/prdai/aws-nitro-attestation-verifier">https://github.com/prdai/aws-nitro-attestation-verifier</a></li><li><a href="https://github.com/cyclicalvc/nitro-enclaves-sdk">https://github.com/cyclicalvc/nitro-enclaves-sdk</a></li><li><a href="https://github.com/aws-samples/sample-nitro-enclaves-attestation">https://github.com/aws-samples/sample-nitro-enclaves-attestation</a></li><li><a href="https://docs.aws.amazon.com/enclaves/latest/user/nitro-enclave.html">https://docs.aws.amazon.com/enclaves/latest/user/nitro-enclave.html</a></li><li><a href="https://man7.org/linux/man-pages/man7/vsock.7.html">https://man7.org/linux/man-pages/man7/vsock.7.html</a></li><li><a href="https://medium.com/@F.DL/understanding-vsock-684016cf0eb0">https://medium.com/@F.DL/understanding-vsock-684016cf0eb0</a></li><li><a href="https://mdlayher.com/blog/linux-vm-sockets-in-go/">https://mdlayher.com/blog/linux-vm-sockets-in-go/</a></li><li><a href="https://medium.com/@mdlayher/linux-vm-sockets-in-go-ea11768e9e67">https://medium.com/@mdlayher/linux-vm-sockets-in-go-ea11768e9e67</a></li><li><a href="https://cborbook.com/introduction/cbor_vs_the_other_guys.html">https://cborbook.com/introduction/cbor_vs_the_other_guys.html</a></li><li><a href="https://medium.com/@contactomyna/cbor-encoding-efficiency-in-data-storage-and-transmission-16e05bfd5241">https://medium.com/@contactomyna/cbor-encoding-efficiency-in-data-storage-and-transmission-16e05bfd5241</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b6361a9722ff" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Throw Away Idea: Decentralized Multi-UAV Frontier Exploration with Communication Efficient Sharing…]]></title>
            <link>https://medium.com/@Programmer-RD-AI/throw-away-idea-decentralized-multi-uav-frontier-exploration-with-communication-efficient-sharing-bce7e07f5123?source=rss-856efb321f48------2</link>
            <guid isPermaLink="false">https://medium.com/p/bce7e07f5123</guid>
            <category><![CDATA[projects]]></category>
            <category><![CDATA[ideas]]></category>
            <category><![CDATA[decentralized]]></category>
            <category><![CDATA[uav]]></category>
            <dc:creator><![CDATA[Ranuga Disansa]]></dc:creator>
            <pubDate>Sun, 28 Dec 2025 04:29:18 GMT</pubDate>
            <atom:updated>2025-12-28T04:29:18.964Z</atom:updated>
            <content:encoded><![CDATA[<h3>Throw Away Idea: Decentralized Multi-UAV Frontier Exploration with Communication Efficient Sharing for Rapid Post Disaster Search</h3><h3><strong>The Problem</strong></h3><p>Post-disaster response is time-critical. Multiple UAVs can cover ground faster than one, but coordinating them when communication is unreliable and bandwidth is limited is hard. Without good coordination, you get redundant coverage, multiple UAVs searching the same area while gaps go unchecked.</p><h3>The Core Idea</h3><p>Instead of a central controller directing each UAV, what if the swarm coordinated themselves decentrally? Each UAV builds a local understanding of what’s been explored, identifies high-value areas to search next, and bids for tasks through minimal peer-to-peer communication. The system only shares what matters for making planning decisions, not raw sensor data, not full maps, just the essential coordination info.</p><h3><strong>Why It Matters</strong></h3><p>You get faster coverage, less wasted effort, and the system keeps working even when communication breaks or gets congested. No single point of failure. The bandwidth overhead stays low because you’re only transmitting coordination signals, not data dumps.</p><p>That’s it. Decentralized swarms, efficient info sharing, disaster response.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=bce7e07f5123" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Understanding the Groundbreaking ‘Attention Is All You Need’ Research Paper]]></title>
            <link>https://medium.com/@Programmer-RD-AI/understanding-the-groundbreaking-attention-is-all-you-need-research-paper-8efa9c50ad56?source=rss-856efb321f48------2</link>
            <guid isPermaLink="false">https://medium.com/p/8efa9c50ad56</guid>
            <category><![CDATA[engineering]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[computer-science]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[mathematics]]></category>
            <dc:creator><![CDATA[Ranuga Disansa]]></dc:creator>
            <pubDate>Tue, 21 May 2024 18:03:28 GMT</pubDate>
            <atom:updated>2024-05-21T18:03:28.420Z</atom:updated>
            <content:encoded><![CDATA[<h3>Abstract</h3><ul><li>Dominant sequence transduction models based on recurrent or convolution neural network while including an encoder and decoder</li><li>Sequence Transduction Models are Models used in text-related applications such as Text Summarization (AskHandle, 2024)</li><li>Models perform best when the encoder and decoder are connected through an attention mechanism</li><li>New simple architecture: The transformer based on attention mechanisms, dispensing (replacing / altering) the recurrence and convolutions entirely</li><li>Transformers are more parallel, which in turn requires less training time.</li><li>Unlike RNNs, transformers process entire sequences simultaneously. This parallelization allows for much faster training times and much longer sequences to be handled. Additionally, the transformer’s self-attention mechanism allows the model to consider the entire data sequence at once (Amazon Web Services, Inc., n.d.)</li><li>Examples</li><li>WMT 2014 English-to-German translation task improving by over 2 BLEU</li><li>BLEU (BiLingual Evaluation Understudy) is used to automatically assess text that has been machine translated (Cloud, n.d.)</li><li>WMT 2014 English-to-French translation Task: new single model state-of-the-Art BLEU Score of 41.0 trained for 3.5 days on 8 GPUs</li></ul><h3>Introduction</h3><ul><li>Recurrent neural networks, long-short-term memory and gated recurrent neural networks are established as the state-of-the art approaches to sequence modelling and transduction problems in applications such as: language modelling and machine translation</li><li>Recurrent models typically factor computation along the symbol positions of the input and output sequences</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WnkNAd04Yfb3KCqlHybZEQ.png" /></figure><ul><li>To generate the hidden state of <strong>ht,</strong> it is produced by using the previous <strong>ht-1</strong> and <strong>xt</strong>. RNNs capture the temporal relationship of the sequential data (so like the hidden state before hand)</li><li>Precludes (don’t allow / stop) parallelization within training examples, which is critical at longer sequence lengths; memory constraints may occur.</li><li>Recent work has significantly improved computational efficiency through factorization tricks and conditional computation, improving model performance.</li><li>Factorization Tricks: There are two easy methods to cut down on parameters and speed up the training process for large Long Short-Term Memory (LSTM) networks (Kuchaiev and Ginsburg, n.d.)</li><li>First, the LSTM matrix is “matrix factorized by design” into the product of two smaller matrices (Kuchaiev and Ginsburg, n.d.)</li><li>The second involves dividing the LSTM matrix’s states, inputs, and independent groups (Kuchaiev and Ginsburg, n.d.)</li><li>Conditional Computation: We apply reinforcement learning as a tool to optimize conditional computation policies in this paper. It functions by selectively activating only a portion of the network at a time (Bengio et al., n.d.)</li><li>The fundamental constraint of sequential computation, however, remains</li><li>Attention mechanisms are an integral part of compelling sequence modelling and transduction models in various tasks, allowing modelling without regard to their distance in the input or output sequences (long-range dependency modeling), used in conjunction with a recurrent network</li><li>Long-Range Dependency Modeling: This enables the model to focus on different parts of the input sequence when predicting each element of the output sequence.</li><li>The Transformer proposes to eschew (avoid) recurrence instead of relying entirely on an attention mechanism to draw global dependencies (relationships) between input and output.</li><li>In turn, Significantly more parallelization will react to the new state of the art in translation quality.</li></ul><h3>Background</h3><ul><li>The Goal is to reduce sequential computation, which forms the foundations of: Extended Neural GPU, ByteNet and ConvS2S</li><li>They all use convolution neural networks as basic building block, computing hidden representations in parallel for all inputs and output positions.</li><li>The key advantage of CNNs in these models is their ability to perform computation in parallel across all positions in the input and output sequences. Unlike recurrent neural networks (RNNs), which process sequences sequentially, CNNs can process multiple positions simultaneously.</li><li>Each position’s representation is influenced by the neighboring positions through convolution filters, allowing the model to capture local dependencies effectively.</li><li>number of operations required to relate signals from arbitrary (any or all possible positions within the input or output sequences) input or output grows with the distance between positions.</li><li>It is difficult to learn dependencies between distant positions.</li><li>Transformers reduce it to a constant number of operations at the cost of reduced effective resolution due to averaging attention-weighted positions, but this is counteracted using-Multi Head Attention.</li><li>Self-attention: Attention mechanism relating different positions of a single sequence in order to compute a representation of the sequence.</li><li>Successfully used in a variety of tasks, including reading comprehension, abstraction summarization, textual entailment, and learning task-independent sentence representations.</li><li>End-to-end memory networks: are based on recurrent attention mechanism instead of sequence-aligned recurrence and have been shown to perform well on simple language question answering and language modeling tasks.</li><li><strong>Recurrent attention mechanism</strong>: This refers to the combination of recurrent processing (where the model maintains a state over time) and attention mechanisms (which allow the model to focus on different parts of the input dynamically).</li><li>Transformer is the first transduction (task of transforming input sequences into output sequences) model relying entirely on self-attention without using sequence-aligned RNNs or convolution.</li></ul><h3>Model Architecture</h3><ul><li>High-performance sequence transduction models have an encoder-decoder structure: Encoder &amp; Decoder.</li><li>Encoder: Maps an input sequence of symbol representations (x1,…,xn) → sequence of continuous representations z = (z1,…,zn)</li><li><em>x</em>1 = “Transformers”</li><li>𝑥2 = “are”</li><li><em>x</em>3 = “powerful”</li><li><em>z</em>1 = [0.23, -0.11, 0.75, …, 0.48] (vector representation of “Transformers”)</li><li><em>z</em>2 = [0.10, -0.45, 0.33, …, 0.56] (vector representation of “are”)</li><li><em>z</em>3 = [0.45, 0.22, -0.77, …, 0.34] (vector representation of “powerful”)</li><li>Decoder: Takes in the z, then decoder generates an output sequence (y1,…,ym) one element at a time.</li><li>The transformer follows this overall architecture using self-attention and point-wise, fully connected layers for both the encoder and decoder.</li><li>Fully connected neural network layers are attached to each position in the sequence independently</li><li>It helps the transformer easily process sequences efficiently and capture complex patterns</li></ul><h3>Encoder and Decoder Stacks</h3><ul><li>Encoder: Composed of a stack of N=6 identical layers.</li><li>Each layer has sub-layers</li><li>First is a multi-head self-attention mechanism</li><li>second is a simple, position-wise, fully connected feed-forward network.</li><li>Residual connection is established around each of the two sub-layers, followed by layer normalization</li><li>A residual connection is a shortcut path that bypasses one or more layers in a neural network. Instead of just passing the input through the layers in sequence, the input is also added directly to the output of the layers.</li><li>output of each sub layer is LayerNorm(x+Sublayer(x)), where Sublayer(x) is the function implemented by the sublayer.</li><li>Facilitate residual connections; sublayers in the model and embedding layers produce outputs of dimension dmodel = 512.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/640/1*lLwPSxrc39LhakhTjr6J6g.png" /><figcaption>(Wikipedia Contributors, 2019)</figcaption></figure><p>Decoder: Composed of a stack of N=6 identical layers</p><ul><li>Addition to the two sub-layers in each encoder layer.</li><li>Inserts a third sublayer that performs multi-head attention over the output</li><li>Employs residual connection around each of the sub-layers</li><li>Modifies the self-attention sub-layer in the decoder stack to prevent positions from attending to subsequent (occurring, coming later or after) positions</li><li>Ensures that the predictions for position i can depend only on the known outputs at position less than i</li></ul><h3>Attention</h3><ul><li>Described as mapping a query and set of key-value pairs to any output where the query, keys, values and output are all vectors</li><li>It is computed as a weighted sum of the values, where the weight assigned to each value is computed by a compatibility function</li></ul><h3>Scaled Dot Product Attention</h3><ul><li>Particular attention “Scaled Dot Product Attention” is used in Transformers</li><li>Input consists of queries and keys of dimension dk and values of dimension dv</li><li>Compute the dot products query with all keys, divide each by sqrt(dk), and apply a soft-max function to obtain the weights on the values.</li><li>We compute the attention function on a set of queries simultaneously, packed together into a matrix Q</li><li>Attention(Q,K,V) = software(QK^T/sqrt(dk))V</li><li>There are two most commonly used attention functions: Additive attention and Dot product (multiplicative) attention</li><li>Dot product attention is identical to the transformer’s algorithm, except for the scaling factor of 1/sqrt(dk)</li><li>Additive attention computes the compatibility function using a feed-forward network with a single hidden layer</li><li>Two are similar in theoretical complexity; dot product attention is much faster and more space efficient due to it being implemented using highly optimized matrix multiplication code</li><li>For small values of dk, the two mechanisms exhibit similarity; additive attention outperforms dot product attention without scaling for larger values of dk.</li><li>For large values of dk, the dot products grow in magnitude, pushing the soft-max function into regions where it has extremely large gradients</li><li>To counteract the transformer’s scale, multiply the dot products by 1/sqrt (dk)</li><li><strong>Scaling Dot Product Attention</strong>: By scaling the dot products by 1/𝑑𝑘1, the Transformer model maintains stable gradients and effective performance even for large values of 𝑑𝑘, leveraging the efficiency of dot product computations while mitigating the potential numerical issues.</li></ul><h3>Multi-Head Attention</h3><ul><li>It is beneficial to linearly project the queries, keys and values h times with different learned linear projections to dk, dk and dv dimensions, respectively</li><li>On these projected versions, we perform the attention function in parallel, yielding dv-dimensional output values</li><li>It allows the model to jointly attend to information from different representation subspaces at different positions</li><li>MultiHead(Q, K, V) = Concat(head1,…, headh)W⁰</li><li>headh = Attention(QWi^Q, KWi^K, VWi^V)</li><li><strong>Q, K, and V</strong>: These stand for Query, Key, and Value matrices, respectively. They are derived from the input sequences and are used in the attention mechanism.</li><li><strong>𝑊𝑄𝑖,𝑊𝐾𝑖,𝑊𝑉i</strong>: These are learned weight matrices for the <em>i</em>th head. They project the original Q, K, and V matrices into different subspaces.</li><li><strong>𝑊𝑂</strong>: This is the output projection weight matrix that combines the outputs from all heads.</li><li>We use 8 parallel attention layers or heads; these use dk = dv = dmodel / h = 64.</li><li>With a reduced dimension for each head, the total computational cost is similar to that of a single head with full dimensionality</li></ul><h3>Applicants of Attention in our Model</h3><ul><li>Uses of multi-head attention in three different ways:</li><li><strong>Encoder-Decoder Attention:</strong> links the encoder and decoder, allowing the decoder to attend to the encoder’s output.</li><li><strong>Self-Attention in the Encoder:</strong> Enables each token in the input sequence to attend to all other tokens, building comprehensive representations.</li><li><strong>Self-Attention in the Decoder:</strong> Ensures each token in the output is generated based on all previously generated tokens while adhering to the auto-regressive property by masking future positions.</li></ul><h3>Position wise Feed Forward Networks</h3><ul><li>Addition to attention sub-layers, each of the layers in the encoder and decoder contains fully connected feed forward networks</li><li>Applied to each position separately and identically</li><li>Consists of 2 linear transformation with a ReLU activation</li><li>Linear transformations are the same across different positions, they use different parameters from layer to layer</li><li>This is as two convolutions with kernal size 1.</li><li>The dimensionality of input and output is dmode = 512, inner layer has dimensionality df = 2048 (allowing for complex feature learning and representation at each layer.)</li></ul><h3>Embedding and Softmax</h3><ul><li>Uses learned embedding to convert the input tokens and output tokens to vectors of dimensions dmodel</li><li>Use the usual learned linear transformation and software function to convert the decoder output to predicted next token probability</li><li>Share the same weight matrix between two embedding layers and pre softmax linear transformation</li><li>In the embedding layers, we multiply those weights by sqrt(dmodel)</li></ul><h3>Positional Encoding</h3><ul><li>Since the transformer has no recurrence and no convolution, in order for the model to make use of the order of the sequence</li><li>Some information is injected about the relative position of the tokens in the sequence</li><li>“Positional encoding” are added to the input embedding, have the same dimension as dmodel</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/236/1*FQt0v2UyK623OSFAIzwfqQ.png" /></figure><ul><li>Sine and Cosine functions of different frequencies are used</li><li>pos is the position and i is the dimension</li><li>Each dimension of the positional encoding corresponds to a sinusoid (sine and cosine functions used to generate the positional encoding.)</li><li>Wavelengths form a geometric progress from 2pie to 10000 * 2pie</li><li>This function was chosen due to it allowing the model to easily learn to attend by relative positions</li><li>Any fixed offset k, PEpos+k can be represented as a linear function of PEpos</li><li>PEpos+k=PEpos+Linear_Function(k)</li><li>Experimented with using learned positional embeddings instead and found that two versions produced nearly identical results</li><li>Chose the sinudoidal it may allow the model to extrapolate to sequence lengths longer than the ones encountered during training</li></ul><h3>Why Self Attention</h3><ul><li>Compare various aspects of self attention layers to the recurrent and convolution layers commonly used for mapping one variable length sequence of symbol representation to another sequence of equal length</li><li>When choosing to use self attention three conditions were considered:</li><li>One is the total computational complexity per layer</li><li>Amount of the computation that be parallelized measuring by the minimum number of sequential operations required</li><li>The third is the path between long range dependencies in the network</li><li>Learning long range dependencies is a key challenge</li><li>One key factor affecting ability to learn such dependencies is the length of the path forward and backward signals have to traverse in the network</li><li>Shorter these paths between any combination of positions in the input and output sequences, easier it is to learn long range dependencies</li><li>Maximum path length between any two input and output positions are compared as well</li><li>As seen in the table 1, self attention connects all positions with a constant number of sequentially executed operations, recurrent layers requires O(n) sequential operations</li><li>Terms of computational complexity, self attention layers are faster than recurrent layers when the sequence length n is smaller</li><li>To improve computation performance for tasks involving very long sequences, self attention could be restricted to considering only a neighborhood size r in the input sequence centered around the respective output position</li><li>Convolution Layers:</li><li>A single convolution layer with kernel width k &lt; n does not connect all pairs of input and output positions</li><li>Doing so requires a stack of O(n/k) convolution layers or O(logk(n)) in the case of dilated convolution</li><li>Increasing the length of the longest paths between any two positions in the network</li><li>Convolution layers generally more expensive than recurrent layers by a factor of k</li><li>As a side benefits self attention could yeild more interpretative models, inspect attention distributions from our models and present and discuss examples in the appendix.</li><li>In summary, self-attention layers offer advantages in terms of computational efficiency, parallelization, and interpret-ability compared to recurrent and convolution layers, especially for tasks involving long sequences. However, the choice of layer type depends on the specific requirements of the task and the trade-offs between computational complexity and interpret ability.</li></ul><h3>Training</h3><h3>Training Data and Batching</h3><ul><li>Trained on the standard WMT 2014 English German dataset consisting of about 4.5 sentence pairs</li><li>Encoded using byte pair encoding, with shared source target vocabulary of about 37k tokens</li><li>English french, significantly larger WMT 2014 English French dataset consisting of 36M sentences are used while being splitting tokens into a 32k word piece vocabulary</li><li>Sentence pairs together by approximate sequence length</li><li>Each training batch contained a set of sentence pairs containing approximately 25k source tokens and 25k target tokens</li></ul><h3>Hardware and Schedule</h3><ul><li>Our models on one machine with 8 NVIDIA P100 GPUs</li><li>Base models using the hyper parameters described throughout, each training stpe took ~ 0.4 seconds</li><li>Was trained for a total of 100k steps or 12 hours</li><li>Big models: step time was ~ 1.0 seconds</li><li>Trained for 300k steps or 3.5 days</li></ul><h3>Optimizer</h3><ul><li>Used the Adam Optimizer with B1 = 0.9, B2 = 0.8 and e = 10^-9</li><li>This corresponds to increasing the learning rate linearly for the first warmup_steps training steps and decreasing it thereafter proportionally.</li><li>lrate = dmodel^-0.5 * min(step_num^-0.5, step_num * warmup_steps^-1.5)</li></ul><h3>Regularization</h3><h3>Residual Dropout</h3><ul><li>Applied to the output of each sub layer, before it is added to the sub layer input and normalized</li><li>Apply dropout to the sums of the embedding and the positional encoding in both the encoder and decoder stacks</li><li>Base model: Rate of Pdrop = 0.1</li></ul><h3>Label Smoothing</h3><ul><li>Employed label smoothing of value Els = 0.1</li><li>Hurts perplexity (a measure used to assess how well a probability model predicts a sample) (Lark Editorial Team, 2023) as the model learns to be more unsure but improves accuracy and BELU score</li></ul><h3>Results</h3><h3>Machine Translation</h3><ul><li>WMT 2014 English to German translation task:</li><li>Big Transformer model outperforms the best previously reported models by more than 2.0 BELU</li><li>New state of the art BELU score of 28.4</li><li>Training took 3.5 days on 8 P100 GPUs</li><li>Base Model surpasses all previously published models and ensembles at a fraction of the training cost</li><li>WMT 2014 English-to-French translation task</li><li>Big model achieves a BELU score of 41.0</li><li>Outperforming all of the previously published single models at less than 1/4 the training cost</li><li>Big model was trained in the dropout rate of Pdrop = 0.1 instead of 0.3</li><li>Base models we used a single model obtained by average the last 5 checkpoints, written at 10 mins intervals</li><li>Big models averaged the last 20 checkpoints</li><li>beam search with a beam size of 4 and length penalty a = 0.6</li><li>Beam search is a popular search algorithm used in sequence prediction tasks such as machine translation and text generation. It is an extension of the greedy search algorithm that explores multiple paths simultaneously to find the most probable sequence.</li><li>Beam search with a beam size of 4 and a length penalty of 𝛼=0.6 maintains the top 4 most probable sequences at each step while adjusting scores to fairly evaluate longer sequences. This helps balance exploration of different sequence possibilities and ensures that the final sequences are both likely and potentially of varied lengths, avoiding the bias toward shorter sequences that would otherwise occur.</li><li>Hyper parameters were chosen after experimentation on the development set</li><li>Maximum output length during inference to input length +50 but terminate early when possible</li></ul><h3>Conclusion</h3><ul><li>The transformer was presented as the first sequence transduction model based entirely on attention, replacing the recurrent layers most commonly used in encoder-decoder architectures</li><li>For translation tasks, Transformer can be trained significantly faster than architectures based on recurrent or convolution layers</li><li>On both WMT 2014 English to German and WMT 2014 English to French translation tasks achieve new state of the art performance</li><li>Model outperforms even all previously reported ensembles</li><li>Excited about the future of attention based models and plan to apply them to otehr tasks</li><li>Plans to extend the Transformer to problems involving input and output modalities other than text and to investigate local, restricted attention mechanisms to efficiently handle large inputs and outputs</li></ul><p><a href="https://github.com/tensorflow/tensor2tensor">https://github.com/tensorflow/tensor2tensor</a></p><h3>References</h3><p>AskHandle. (2024). <em>What Is Dominant Sequence Transduction Models in AI Training?</em> [online] Available at: <a href="https://www.askhandle.com/blog/what-is-dominant-sequence-transduction-models-in-AI-training">https://www.askhandle.com/blog/what-is-dominant-sequence-transduction-models-in-AI-training</a> [Accessed 19 May 2024].</p><p>Cloud, G. (n.d.). <em>Evaluating models | AutoML Translation Documentation</em>. [online] Google Cloud. Available at: <a href="https://cloud.google.com/translate/automl/docs/evaluate#:~:text=BLEU%20(BiLingual%20Evaluation%20Understudy)%20is">https://cloud.google.com/translate/automl/docs/evaluate#:~:text=BLEU (BiLingual Evaluation Understudy) is</a>.</p><p>Vaswani, A., Shazeer, N., Parmar, N., Uszkoreit, J., Jones, L., Gomez, A., Kaiser, Ł. and Polosukhin, I. (2017). <em>Attention Is All You Need</em>. [online] Available at: <a href="https://proceedings.neurips.cc/paper_files/paper/2017/file/3f5ee243547dee91fbd053c1c4a845aa-Paper.pdf">https://proceedings.neurips.cc/paper_files/paper/2017/file/3f5ee243547dee91fbd053c1c4a845aa-Paper.pdf</a>.</p><p>Amazon Web Services, Inc. (n.d.). <em>What are Transformers? Transformers in Artificial Intelligence Explained, AWS</em>. [online] Available at: <a href="https://aws.amazon.com/what-is/transformers-in-artificial-intelligence/">https://aws.amazon.com/what-is/transformers-in-artificial-intelligence/</a>.</p><p>Kuchaiev, O. and Ginsburg, B. (n.d.). <em>Workshop track: -ICLR 2017 FACTORIZATION TRICKS FOR LSTM NETWORKS</em>. [online] Available at: <a href="https://arxiv.org/pdf/1703.10722v3">https://arxiv.org/pdf/1703.10722v3</a> [Accessed 19 May 2024].</p><p>Bengio, E., Bacon, P.-L., Pineau, J. and Precup, D. (n.d.). <em>CONDITIONAL COMPUTATION IN NEURAL NETWORKS FOR FASTER MODELS</em>. [online] Available at: <a href="https://arxiv.org/pdf/1511.06297">https://arxiv.org/pdf/1511.06297</a> [Accessed 19 May 2024].</p><p>Wikipedia Contributors (2019). <em>Residual neural network</em>. [online] Wikipedia. Available at: <a href="https://en.wikipedia.org/wiki/Residual_neural_network">https://en.wikipedia.org/wiki/Residual_neural_network</a>.</p><p>Lark Editorial Team (2023). <em>Perplexity</em>. [online] <a href="http://larksuite.com/">Larksuite.com</a>. Available at: <a href="https://www.larksuite.com/en_us/topics/ai-glossary/perplexity">https://www.larksuite.com/en_us/topics/ai-glossary/perplexity</a> [Accessed 21 May 2024].</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8efa9c50ad56" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Unlocking Software Architectural Designs: Patterns, Models, and Checklists]]></title>
            <link>https://medium.com/@Programmer-RD-AI/unlocking-software-architectural-designs-patterns-models-and-checklists-94948a976502?source=rss-856efb321f48------2</link>
            <guid isPermaLink="false">https://medium.com/p/94948a976502</guid>
            <category><![CDATA[software-architecture]]></category>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[software]]></category>
            <category><![CDATA[software-testing]]></category>
            <dc:creator><![CDATA[Ranuga Disansa]]></dc:creator>
            <pubDate>Tue, 14 May 2024 09:32:38 GMT</pubDate>
            <atom:updated>2024-05-14T09:32:38.411Z</atom:updated>
            <content:encoded><![CDATA[<h3>Introduction</h3><ul><li>Representation of the system to understand its behaviour</li><li>Architectural design: Process of defining hardware and software components in a computer system</li><li>Software (System) requirements transformed into an architecture</li><li>Software Architecture: framework established to specify components, inputs, outputs, functions and interactions</li></ul><h3>Why is architectural design important?</h3><ul><li>Describes the concept level where the designers can specify the functional and non-functional requirements.</li><li>Acts as a guideline for enhancing the system</li><li>Develops and documents top-level design for the external interfaces</li><li>Develop preliminary versions of user documentation</li><li>Describe and document preliminary test requirements</li><li>Schedule for software integration</li></ul><h3>Sources for Architectural Designs</h3><ul><li>Domain-related information</li><li>Data flow diagrams</li><li>Availability of architectural patterns</li><li>Architectural styles</li></ul><h3>Architectural Design Models</h3><ul><li>Structural model: architecture as an ordered collection of program components</li><li>Dynamic model: The behavioural aspect of the software architecture indicates how the structure of the system configuration can</li><li>Process model: Business or technical processes implemented in the system</li><li>Function model: Functional hierarchy of a system</li><li>Framework model: Identifying repeatable architectural design patterns leads to an increase in the level of abstraction</li></ul><h3>Important Features of a Good Architecture</h3><ul><li>Try to address the requirements of several stakeholders</li><li>Both functional and non-functional requirements</li><li>Represent all of the use cases and scenarios and hide implementation details</li></ul><h3>Architecture Checklist</h3><ul><li>process of converting software characteristics into a structured solution</li><li>Characteristics of software that can affect a software architecture design</li><li>Performance: Time required to respond to stimuli (events); the number of events processed in some interval of time</li><li>Security: a measure of the system’s ability to resist unauthorized attempts</li><li>Availability: Proportion of time the system is up and running</li><li>Modifiability: Make changes to a system quickly and cost-effectively</li><li>Portability: System to run under different computing environments</li><li>Considered a special kind of modifiability</li><li>Functionality: System to do the work for which it was intended</li><li>Extensibility: New feature implementation/replacement of components</li><li>Removal of unwanted components</li><li>Conceptual Integrity: Underlying theme or vision that unifies the design of the system</li><li>Interoperability: Interaction with other sub-systems, well-defined access to externally visible functionality</li><li>Usability: How easy is it to use the program?</li><li>Maintainability: Problem fixing, repairing a software system after errors</li><li>Efficacy: Use of the resources available for execution of software and how this impacts the response time</li><li>Testability: How easy is it to code a unit or subsystem?</li><li>Reusability: The ability to reuse the SW architecture for another application</li><li>Ease of Deployment: How quickly can you deploy the system?</li><li>Ease of Administration: Infrastructure, tools and staff of Administrators and Technicians. maintain the health of the application</li><li>Scalability: Number of user changes</li><li>Debug ability and Monitoring: Cost and time-saving mechanism</li><li>Develop Productivity: Cost- and Time-Saving Mechanisms, and applications based on the software architecture</li></ul><h3>Software Architecture Patterns</h3><h3>Layered Pattern</h3><ul><li>Used to structure programs</li><li>Decomposed into groups of sub-taks</li><li>Particular level of abstraction</li><li>Provides services to the next higher layer</li><li>4 layers of general information:</li><li>Presentation layer (UI layer)</li><li>Application layer (Service Layer)</li><li>Business Logic Layer (Domain Layer)</li><li>Data Access Layer (persistence layer)</li><li>Usage:</li><li>General desktop applications</li><li>E-commerce web applications</li></ul><p><strong>Advantages</strong>:</p><ul><li>Modular structures facilitate scalability and maintainability.</li><li>A clear separation of concerns enhances code organization and understandability.</li><li>Each layer can be developed, tested, and updated independently.</li></ul><p><strong>Disadvantages</strong>:</p><ul><li>Can introduce overhead due to multiple layers of abstraction.</li><li>Dependency between layers can lead to cascading changes if modifications are required.</li><li>May not be suitable for highly complex or dynamically changing systems.</li></ul><h3>Master slave pattern</h3><ul><li>It consists of two parts: master and slaves</li><li>master distributes the work among identical slave companies and computes a result from the results that the slaves report</li><li>Usages:</li><li>In database replication, the master database, authorization</li><li>Authoriazatrion source</li><li>Slave databases are synchronized to it</li></ul><p><strong>Advantages</strong>:</p><ul><li>Distributes workload efficiently among multiple nodes, improving performance.</li><li>Allows for fault tolerance and redundancy by replicating data across multiple slaves.</li><li>Scalable architecture that can handle increasing loads by adding more slaves.</li></ul><p><strong>Disadvantages</strong>:</p><ul><li>Complexity in managing communication and synchronization between master and slave.</li><li>Single point of failure if the master node goes down.</li><li>Synchronization overhead can impact overall system performance.</li></ul><h3>Pipe Filter Pattern</h3><ul><li>Used to structure systems</li><li>Produce a stream of data</li><li>Each process is enclosed within a filter component</li><li>Processing is passed through</li><li>Pipes can be used for buffering and synchronization purposes</li><li>Usages:</li><li>A Filter architecture pattern can be a web application</li></ul><p><strong>Advantages</strong>:</p><ul><li>Promotes modularity and reusability by breaking down processing tasks into independent filters.</li><li>Supports parallel processing and pipelining, improving performance.</li><li>Easy to understand and maintain due to the clear separation of concerns.</li></ul><p><strong>Disadvantages</strong>:</p><ul><li>May introduce latency due to the sequential nature of processing.</li><li>It is difficult to handle complex data dependencies between filters.</li><li>Limited flexibility in handling dynamic changes to processing pipelines.</li></ul><h3>Broker pattern</h3><ul><li>Structure distributed systems with decoupled components</li><li>Components: interact by remote service invocations</li><li>Broker compoent: responsible for the coordination of communication among compoenents</li><li>Servers publish their capabilities to a broker.</li><li>Clients request a service from their broker</li><li>broker then redirects the client to a suitable service from its registry</li><li>Usages:</li><li>Web services</li></ul><p><strong>Advantages</strong>:</p><ul><li>Decouples components, allowing for easier integration and scalability.</li><li>A centralized broker facilitates communication and coordination between distributed components.</li><li>Supports dynamic discovery and binding of services, promoting flexibility.</li></ul><p><strong>Disadvantages</strong>:</p><ul><li>Single point of failure if the broker goes down.</li><li>Increased network overhead due to messages passing through the broker.</li><li>Complexity in managing and configuring the broker and service registry.</li></ul><h3>Peer-to-peer pattern</h3><ul><li>Each person is called a peer</li><li>Every component can play any role and also change its role dynamically</li><li>When a peer requests a service, it is called a client, and the request is called a server</li><li>Usage:</li><li>A peer-to-peer architecture pattern is a file-sharing network like Skype or BitTorrent. Skype uses VoIP (P2P). To send messages or make voice calls</li></ul><p><strong>Advantages</strong>:</p><ul><li>Decentralized architecture promotes fault tolerance and scalability.</li><li>Eliminates single points of failure and bottlenecks, improving robustness.</li><li>Supports dynamic network topologies and self-organization.</li></ul><p><strong>Disadvantages</strong>:</p><ul><li>Challenges in maintaining consistency and data integrity across peer nodes.</li><li>Security concerns due to the lack of centralized control and authentication.</li><li>Limited support for centralized services and resource management.</li></ul><h3>Event bus pattern</h3><ul><li>Data is delegated to multiple modules</li><li>Each module has a specific data type, which helps in managing development efforts</li><li>The event-driven architecture differs from an N-tiered architecture, where data flows through every tier.</li><li>Modules interact only with the tagged events and not all.</li><li>Patterns are scalable and easily adaptable; enterprises prefer this pattern</li><li>Example: When a user registers for an application.</li><li>The user enters the name and mail ID; the account is created, and it is called an event</li><li>Usage:</li><li>It is useful for developing an e-commerce website</li></ul><p><strong>Advantages</strong>:</p><ul><li>Promotes loose coupling between components, enhancing modularity and flexibility.</li><li>Simplifies communication and coordination between modules through asynchronous events.</li><li>Supports scalability and extensibility by allowing the easy addition of new event handlers.</li></ul><p><strong>Disadvantages</strong>:</p><ul><li>Debugging and tracing event flows can be challenging in complex systems.</li><li>May introduce performance overhead due to event propagation and handling.</li><li>Dependency on event bus implementation and configuration.</li></ul><h3>Model view controller pattern</h3><ul><li>Also known as the MVC pattern, interactive application are divided into 3 parts:</li><li>Model: Core functionality and data</li><li>View: Displays the information to the user</li><li>Controller: Handles the input from the user</li><li>Separate internal representations of information</li><li>Decouples components and allows efficient code reuse</li><li>Usages:</li><li>World Wide Web applications in major programming languages</li><li>Web frameworks such as Django and rails</li></ul><p><strong>Advantages</strong>:</p><ul><li>Separation of concerns improves code organization, maintainability, and testability.</li><li>Supports multiple views for the same model, enabling flexible user interfaces.</li><li>Promotes code reuse and modularity by isolating business logic from presentation logic.</li></ul><p><strong>Disadvantages</strong>:</p><ul><li>Complexity can increase with the number of controllers and interactions between components.</li><li>Tight coupling between model, view, and controller can lead to code dependencies.</li><li>Overhead in implementing and maintaining the pattern, especially for small-scale applications.</li></ul><h3>Blackboard pattern</h3><ul><li>It is useful for problems for which no deterministic solutions or strategies are known</li><li>3 main components:</li><li>Blackboard: Structure global memory</li><li>Knowledge source: Specialized modules</li><li>Control Component: selects, configures, and executes modules</li><li>All the competitors have access to the blackboard.</li><li>It produces new data objects that are added to the blackboard</li><li>Compoennants look for particular kinds of data on the blackboard and may find these by pattern matching with their existing knowledge</li><li>Usages:</li><li>Speech recognition</li><li>Vehicle identification and tracking</li><li>Protein structure identification</li><li>Sonar signals and interpretation</li></ul><p><strong>Advantages</strong>:</p><ul><li>Flexibility in handling complex, non-deterministic problems with no predefined solution.</li><li>Encourages collaboration and knowledge sharing among specialized modules.</li><li>Supports incremental problem-solving through asynchronous data updates on the blackboard.</li></ul><p><strong>Disadvantages</strong>:</p><ul><li>Complexity in designing and managing the blackboard structure and knowledge sources.</li><li>Challenges in coordinating and synchronizing interactions between multiple modules.</li><li>Performance overhead is due to frequent data updates and pattern matching.</li></ul><h3>Client-server architecture</h3><ul><li>There are two major entities.</li><li>Server and multiple clients</li><li>The server has resources (data, files or services)</li><li>client requests the server for a particular resource</li><li>the server processes the request and responds accordingly</li><li>Usages:</li><li>Email</li><li>WWW</li><li>File-sharing apps</li><li>Banking</li></ul><p><strong>Advantages</strong>:</p><ul><li>Scalable architecture that supports distributed computing and client-server interactions.</li><li>Centralized management of resources improves security, data consistency, and access control.</li><li>Facilitates client access from diverse platforms and devices over a network.</li></ul><p><strong>Disadvantages</strong>:</p><ul><li>Single point of failure if the server goes down.</li><li>Increased network overhead and latency due to client-server communication.</li><li>Dependencies on server availability and performance for client functionality.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/469/1*uc0PblGtfxF_piolrb8avw.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=94948a976502" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Mastering Software Testing: Techniques, Life Cycle, and Cyclomatic Complexity]]></title>
            <link>https://medium.com/@Programmer-RD-AI/mastering-software-testing-techniques-life-cycle-and-cyclomatic-complexity-ffd1e316f65f?source=rss-856efb321f48------2</link>
            <guid isPermaLink="false">https://medium.com/p/ffd1e316f65f</guid>
            <category><![CDATA[testing]]></category>
            <category><![CDATA[testing-tools]]></category>
            <category><![CDATA[software]]></category>
            <category><![CDATA[cyclomatic-complexity]]></category>
            <category><![CDATA[software-development]]></category>
            <dc:creator><![CDATA[Ranuga Disansa]]></dc:creator>
            <pubDate>Tue, 14 May 2024 09:30:23 GMT</pubDate>
            <atom:updated>2024-05-14T09:30:23.439Z</atom:updated>
            <content:encoded><![CDATA[<h3>What is software testing?</h3><ul><li>One of the stages in SDLC(Software Development Life Cycle)</li><li>Activity to check the software system</li><li>Whether results match with the expected results ensures that the software system is error-free</li><li>Helps to identify errors, missing requirements</li><li>Done either manually or using automated tools</li></ul><h3>Advantages</h3><ul><li>Reduce the overall cost</li><li>Ensures that the system behaves the same</li><li>Required to check the reliability of the system</li><li>Ensures that the system is free from any bug</li></ul><h3>Software Testing Life Cycle (STLC)</h3><ul><li>Series of specific activities conducted during the testing process to ensure the software quality goals are met</li><li>Involves both verification and validation activities</li><li>The validation process of checking whether the specification captures the customer’s requirement</li><li>Verification is the process of checking that the software meets specific requirements.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/584/1*XjSl4_ZOj133SN9ZKJmoFA.png" /></figure><h3>Phases of the STLC Model</h3><h3>Requirements Analysis</h3><ul><li>QA team studies the requirements and identifies the testable requirements</li><li>Interact with various stakeholders to understand the requirements in detail</li><li>Functional or non-functional</li><li>Activities:</li><li>Identify types of tests</li><li>Gather details about testing priorities and findings.</li><li>Identify test environment details</li></ul><h3>Test Planning</h3><ul><li>The senior QA manager will determine effort and cost estimates</li><li>finalize the test plan</li><li>test strategy is also determined</li><li>Activities:</li><li>Preparation of test plan</li><li>test tool selection</li><li>test effort estimation</li><li>resource planning</li><li>determining roles and responsibilities</li><li>training requirements</li></ul><h3>Test Case Development</h3><ul><li>Creation, verification and rework of test cases and test scripts</li><li>Test data is identified created, reviewed and then reworked as well</li><li>Activities:</li><li>Create test cases and automation scripts</li><li>Review and baseline test cases and scripts</li><li>Create test data</li></ul><h3>Test Environment Setup</h3><ul><li>Important aspects of the testing process can be done in parallel with the test case development stage</li><li>May not be involved in this activity if the customer/development team provides the test environment</li><li>Activities:</li><li>Understand the required architecture, environment, and hardware and software requirements</li><li>Setup test environment and test data</li><li>Perform a smoke test to determine if a new software build is ready for the next testing phase</li><li>Determine whether the software is stable enough to proceed with further testing</li></ul><h3>Test Execution</h3><ul><li>QA team will carry out the testing based on the test plans and test cases</li><li>Bugs will be reported to the development team</li><li>retesting will be performed</li><li>Activities:</li><li>Execute tests as per the plan</li><li>Document test results</li><li>Retest the defects and fix them.</li><li>Track the defects to closure</li></ul><h3>Test Cycle Closure</h3><ul><li>Meet, discuss and analyze the testing artefacts</li><li>identify strategies that have to be implemented in the future</li><li>Activities:</li><li>Evaluate cycle and completion criteria</li><li>Based on time, test coverage, cost, software-critical business objectives, and quality</li><li>Preparing test metrics on parameters</li><li>Document the learning of the project</li><li>prepare test closure report</li><li>qualitative and quantitative reporting</li><li>test result analysis to find out the defect t-distribution</li></ul><h3>Static and Dynamic Testing</h3><ul><li>Two fundamental approaches used in software engineering to ensure the quality and correctness of software systems</li><li>Static testing focuses on analyzing the software artefacts without execution to find defects early.</li><li>dynamic testing involves executing the software to validate its behavior and functionality</li></ul><h3>Static Testing</h3><ul><li>Software testing technique that involves the examination of code, requirements and documentation without executing the program</li><li>The primary goal is to identify defects early in the development process before the code is executed</li><li>It helps in finding issues such as syntax errors, logical errors, design flaws, and adherence to coding standards</li><li>Static testing methods include code reviews, walkthroughs, inspections, and automated analysis tools</li><li>Involve human inspection and automated checks to detect potential issues</li><li>Static testing helps improve the quality of the software by detecting and fixing defects early, reducing the cost of rework, and ensuring compliance with coding standards and best practices</li></ul><h3>Dynamic Testing</h3><ul><li>Software testing technique that involves executing the software and observing its behavior during run time</li><li>Validate the functional and non-functional aspects of the software with different inputs and test scenarios</li><li>Identifying defects related to functionality, performance, security and reliability</li><li>Methods include unit testing, integration testing, system testing, and acceptance testing</li><li>Various types of functional and non-functional testing</li><li>Involve creating test cases, executing them against the software, and comparing the actual results with expected results</li><li>It helps in verifying the correctness and reliability of the software by simulating real-world usage scenarios</li><li>Communication with stakeholders about the quality of the software</li><li>Ensures that it meets the specified requirements</li></ul><h3>Test Levels</h3><ul><li>Component Testing</li><li>Integration Testing</li><li>System Testing</li><li>Acceptance Testing</li></ul><h3>Component Testing</h3><ul><li>Also known as unit testing</li><li>testing individual components of a software system in isolation</li><li>Components can be functions, classes, methods or procedures</li><li>The main goal is to validate that each component behaves as expected and functions correctly according to its specification</li><li>Identifying defects early in the development</li><li>Ensures the reliability of individual components before integration</li></ul><h3>Integration Testing</h3><ul><li>process of testing the interactions between different components of software systems combined</li><li>It verifies that the interfaces between companies</li><li>Ensures that individual components work together seamlessly</li><li>Identifying defects related to data flow, communication between the company’s integration points</li></ul><h3>System Testing</h3><ul><li>complete and integrated software system evaluate its compliance with specified requirements</li><li>Testing the system as a whole, functionality, performance, reliability and other quality attributes</li><li>primary goals validate that the entire software system meets the specified requirements</li><li>performs as expected in its intended environment</li><li>Identifying defects that may arise due to interactions between competitors, system configuration, external dependencies</li></ul><h3>Acceptance Testing</h3><ul><li>The final phase of testing is where the software system is evaluated to determine whether it satisfies the acceptance criteria</li><li>Performed by end users or stakeholders in a real or simulated environment</li><li>Verifies that the software system meets the business requirements and objectives and is ready for deployment</li><li>The validated system meets user expectations and delivers the intended value</li><li>Gaining confidence from stakeholders ensures that the software system is ready for production use</li></ul><h3>Testing Techniques</h3><h3>Black Box Testing Techniques</h3><ul><li>Validate the functional requirements specified in FRS (functional requirement specification document)</li><li>Done manually or can be automated</li><li>ECP (Equivalence Class Partitioning)</li><li>Boundary Value Analysis</li><li>Cause-effect graphing</li><li>Comparison Testing</li><li>Fuzz testing</li><li>Model-based testing</li></ul><h3>White BoxTechniqueschniqauesThe internal structure of the software is known as White box testing</h3><ul><li>the internal structure of the software is known as White box testing</li><li>Requires programming knowledge</li><li>Also known as open box or glass testing</li></ul><h3>Cyclomatic Complexity</h3><ul><li>Cyclomatic Complexity: testing metric used for measuring the complexity of a software program</li><li>A quantitative measure of independent paths</li><li>Calculated using control flow graphs or concerning functions, modules, methods or classes within a software program</li><li>Control Flow Graph (CFG): a graphical representation of the control flow or computation during program execution</li><li>It helps analyze program behaviour</li><li>Commonly used in static analysis and compiler applications</li><li>Types</li><li>Sequence</li><li>While</li><li>If not, then else</li><li>Until</li><li>Interpretation</li><li>Quantitative measure of the logical complexity</li><li>High cyclomatic complexity</li><li>higher program complexity</li><li>potentially more difficult-to-maintain code</li><li>Application</li><li>Often used during code reviews</li><li>Software maintenance identifies complex areas of code</li></ul><h3>Nodes</h3><ul><li>Individual statements or decision points in the code</li><li>Include things like loops and conditions (if and switch statements)</li></ul><h3>EdgesThe flow of control between nodes</h3><ul><li>Flow of control between nodes</li><li>Indicate the possible transactions</li><li>Based on the execution of the program</li></ul><h3>Examples</h3><ul><li>Cyclomatic Complexity = E — N + 2</li><li>CC = No. of Edges — No. of Nodes + 2</li><li>Sequence</li><li>CC = E — N + 2</li><li>If not, then else</li><li>CC = E — N + 2</li><li>While</li><li>CC = E-N + 2</li><li>Until</li><li>CC = E — N + 2</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ffd1e316f65f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Mastering Code Quality: Best Practices, Standards, and Review Techniques]]></title>
            <link>https://medium.com/@Programmer-RD-AI/mastering-code-quality-best-practices-standards-and-review-techniques-ba2fec1be3c6?source=rss-856efb321f48------2</link>
            <guid isPermaLink="false">https://medium.com/p/ba2fec1be3c6</guid>
            <category><![CDATA[review]]></category>
            <category><![CDATA[quality]]></category>
            <category><![CDATA[code]]></category>
            <category><![CDATA[standards]]></category>
            <category><![CDATA[software]]></category>
            <dc:creator><![CDATA[Ranuga Disansa]]></dc:creator>
            <pubDate>Tue, 14 May 2024 09:28:13 GMT</pubDate>
            <atom:updated>2024-05-14T09:28:13.416Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nJVWy5D5f7dDpY353URNoQ.jpeg" /></figure><h3>Coding Styles and Standards</h3><ul><li>code must be as clean and easy to read as possible</li><li>The art of programming</li><li>Complex task and code it in a way that is both correct and human-readable</li><li>Make their coding standards and guidelines depending on their organization and types of software</li><li>It is important to maintain coding standards to avoid rejection during code review</li></ul><h3>Purpose of Having Coding Standards</h3><ul><li>Uniform appearance to the codes</li><li>Improves readability and maintainability reduces complexity also</li><li>Code reuse helps detect errors easily</li><li>Promote sound programming practices and increase efficiency</li></ul><h3>Coding Standards</h3><h3>Limited use of global</h3><ul><li>Rules tell about the types of data that can be declared global and the data that cannot be</li></ul><h3>Standard headers for different modules</h3><ul><li>Different modules should follow some standard format and information</li><li>Contain below things</li><li>Eg:</li><li>Name of the module</li><li>Author</li><li>Modification History</li><li>Synopsis on the module and what it does</li><li>Different functions supported in the module, along</li><li>Global variables accessed or modified by the module</li></ul><h3>Naming conventions for local variables, global variables, constants and functions</h3><ul><li>Naming conventions are given below</li><li>Meaningful and understandable variable names</li><li>Local variables should be named using camel case (local data)</li><li>Global variables start with a capital (GlobalData)</li><li>Constant names are capitalized only (CONSDATA)</li><li>Avoid the use of digits</li><li>function camel case starting with small letters</li><li>function, describe the reasons for using the function clearly and briefly</li></ul><h3>Indentation</h3><ul><li>It is very important to increase the readability of the code</li><li>Should use while spaces properly</li><li>Examples:</li><li>Space after giving a comma between two function arguments</li><li>Each nested block should be properly indented and spaced</li><li>Proper indentation should be there at the beginning</li><li>At the end of each block in the program,</li><li>All braces should start from a new line and the code following the end braces should also start from a new line</li></ul><h3>Error reporting values and exception handling conventions</h3><ul><li>Functions an error condition should either return a 0 or 1 to simplify the debugging</li><li>Other hands give some general suggestions regarding the coding style to follow</li><li>improvement in the understandability and readability of the code</li></ul><h3>Avoid using a coding style that is too difficult to understand</h3><ul><li>Easily understandable</li><li>Complex code makes maintenance and debugging difficult and expensive</li></ul><h3>Avoid using an identifier for multiple purposes</h3><ul><li>Each variable should be given a descriptive and meaningful name</li><li>It is not possible if an identifier is used for multiple purposes</li><li>this can lead to confusion</li><li>leads to more difficulty during future enhancements</li></ul><h3>code should be well-documented</h3><ul><li>The code should be properly commented</li><li>increase the understanding of the code</li></ul><h3>The length of functions should not be very large</h3><ul><li>Lengthy functions are very difficult to understand</li><li>Functions should be small enough to carry out small tasks</li><li>Longer functions should be broken into smaller ones</li></ul><h3>Try not to use GOTO statements</h3><ul><li>Makes the program unstructured</li><li>reduces the understandability</li></ul><h3>Advantages of Coding Guidelines</h3><ul><li>Increase the efficacy</li><li>reduces the development time</li><li>Help in detecting errors in the early phases</li><li>reduce the extra cost incurred by the software project</li><li>maintained properly</li><li>code increases readability and understandability</li><li>reduces the complexity of the code</li><li>reduce the hidden cost</li></ul><h3>Code Reviews</h3><ul><li>Code review or peer code review</li><li>Act of consciously and systematically conveying with one’s fellow programmers to check each other’s code for mistakes</li><li>Save time and money</li><li>streamlining the development process</li><li>reducing quality assurance teams’ work</li><li>catch bugs</li><li>Greater communication, Comradeship, ownership, and education; context of junior developers</li></ul><h3>Techniques</h3><ul><li>Peer Review</li><li>Desk Check</li><li>Software Walkthrough</li><li>Software inspection</li><li>Software Audit</li></ul><h3>Peer Review</h3><ul><li>Involves colleagues or team members examining each other’s work to identify defects improve quality and share knowledge</li><li>Various forms, such as pair programming</li><li>tool-assisted reviews by using a version control system</li><li>Manual reviews of code changes</li><li>emphasis is on collaboration</li><li>learning from each other’s expertise</li></ul><h3>Desk Check</h3><ul><li>Referred to as an overtime shoulder review, an informal review conducted by a developer or team lead who physically sits with another developer</li><li>Done on an ad-hoc basis (straight to code without any sort of design document preparation) providing immediate feedback, mentoring junior developers and resolving issues quickly</li></ul><h3>Software Walkthrough</h3><ul><li>Types of informal review where the author of the software presents their work to a group of colleagues or stakeholders</li><li>The purpose is to get feedback and discuss potential issues</li><li>ensure that everyone understands the design or implementation</li><li>less formal than other review types</li><li>often focuses on high-level concepts</li></ul><h3>Software Inspection</h3><ul><li>The formal review process aims to find defects early in the development process</li><li>Structured meetings where a team of reviewers examine the software looking for errors, inconsistencies and violations of standards</li><li>Follow a predefined checklist and involve rigorous analysis</li></ul><h3>Software Audit</h3><ul><li>Independent examination of software processes, practices and products to assess compliance with organizational policies, standards or regulations</li><li>Conducted internally.led by the organization’s quality assurance team or externally by third-party auditors</li><li>Identify areas for improvement, ensure adherence to best practices and mitigate risks</li></ul><h3>Version Controlling</h3><ul><li>A system that records changes to a file or set of files over time</li><li>I can recall specific versions later</li><li>Version control, also known as source control, is the practice of tracking and managing changes to software code</li><li>Software tools that help software teams manage changes to source code over time</li><li>Accelerated version control systems help software teams work faster and smarter</li><li>It is especially useful for DevOps teams to reduce development time and increase successful deployments</li></ul><h3>Versrion Control Software</h3><ul><li>Github</li><li>Gitlab</li><li>Beanstalk</li><li>PerForce</li><li>Apache Subversion</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ba2fec1be3c6" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Demystifying Software Quality: A Comprehensive Guide to Understanding and Measuring Quality in…]]></title>
            <link>https://medium.com/@Programmer-RD-AI/demystifying-software-quality-a-comprehensive-guide-to-understanding-and-measuring-quality-in-1704ebee5daa?source=rss-856efb321f48------2</link>
            <guid isPermaLink="false">https://medium.com/p/1704ebee5daa</guid>
            <category><![CDATA[software-testing]]></category>
            <category><![CDATA[software-architecture]]></category>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[software]]></category>
            <dc:creator><![CDATA[Ranuga Disansa]]></dc:creator>
            <pubDate>Tue, 14 May 2024 09:23:22 GMT</pubDate>
            <atom:updated>2024-05-14T09:23:22.880Z</atom:updated>
            <content:encoded><![CDATA[<h3>Demystifying Software Quality: A Comprehensive Guide to Understanding and Measuring Quality in Software Development</h3><figure><img alt="Software Qualitt" src="https://cdn-images-1.medium.com/max/1024/1*NhqkHQ3om2ChSX3Lhe7gJQ.jpeg" /></figure><h3>Software Quality</h3><ul><li>Measures whether the software satisfies its user requirements</li><li>Software requirements are classified as either functional or non-functional.</li><li>Functional requirements</li><li>It could be calculations, technical details, data processing or definite function</li><li>Describes what the software application is intended to accomplish</li><li>Non Functional requirements</li><li>Include things like disaster recovery, portability, privacy, security, supportability and usability</li></ul><h3>Software Quality Management</h3><ul><li>Ensures users are satisfied with software performance</li><li>The process consists of:</li><li>Quality assurance</li><li>Quality planning</li><li>Quality control of the product</li><li>Accomplished by software quality managers, software testing professionals, and software developers, the high quality of the product</li></ul><h3>Software Quality Characteristics</h3><ul><li>Determined by individual quality characteristics and factors</li><li>Divided into two categories</li><li>Measured directly, such as the number of logical errors</li><li>Measured only indirectly. For example: maintainability, usability</li></ul><h3>Standard Software Quality Characteristics</h3><ul><li>ISO / IEC 9126 defines software quality as a structured set of individual quality characteristics</li><li>Revised ISO / IEC 25010</li><li>8 main quality characteristics</li><li>6 Main Characteristics:</li><li>Functionality</li><li>Reliability</li><li>Usability</li><li>Efficiency</li><li>Maintainability</li><li>Portability</li></ul><h3>Functionality</h3><ul><li>Suitability</li><li>Provide an adequate set of functions for specified tasks and user objectives</li><li>Accuracy</li><li>Capability of the software to provide accurate results</li><li>Interoperability</li><li>Capability of the software to interact</li></ul><h3>Reliability</h3><ul><li>Maturity</li><li>Prevent failure as a result of faults in the software</li><li>Fault Tolerance</li><li>Maintain a specific level of performance in case of software faults</li><li>Recoverability</li><li>Restore its level of performance and recover the data</li></ul><h3>Usability</h3><ul><li>Understandability</li><li>The ability of the software product to be understood by the user</li><li>Learnability</li><li>Enable the user to learn its applications</li><li>Operability</li><li>Easily operated by the user</li></ul><h3>Efficiency</h3><ul><li>Time Behaviour</li><li>Provide appropriate response and processing times</li><li>Resource Utilization</li><li>Use appropriate resources at an appropriate time when the software performs its function</li></ul><h3>Maintainability</h3><ul><li>Analyzability</li><li>ability to diagnose the causes of failures in the software</li><li>Changeability</li><li>Capability to enable a specified modification to be implemented</li><li>Stability</li><li>Capability to minimize unexpected effects from modifications of the software</li><li>Testability</li><li>Capability to enable modified software to be validated</li></ul><h3>Portability</h3><ul><li>Adaptability</li><li>Capability, adapted to different specific environments</li><li>Coexistence</li><li>Coexist with other independent software</li><li>Replaceability</li><li>Used in place of other specified software in the environment of the software</li></ul><h3>Software Quality Metrics</h3><ul><li>Define metrics to assess quality characteristics</li><li>Measures of software characteristics which are quantifiable or countable</li><li>Lines of code, number of bugs reported, function points, etc.</li><li>a subset of software metrics that focus on the quality aspects</li></ul><h3>Software Metrics Classification</h3><ul><li>Types of Classifications</li><li>Product quality metrics</li><li>In-process quality metrics</li><li>Maintenance quality metrics</li></ul><h3>Product Metrics</h3><ul><li>Characteristics of the product, such as size, complexity, design features, performance and quality level</li></ul><h3>Process Metrics</h3><ul><li>Used to improve the development and maintenance activities of the software</li></ul><h3>Project Metrics</h3><ul><li>Describe the project&#39;s characteristics and execution</li><li>Example: Number of software developers, staffing pattern over the life cycle of the software, cost, schedule and productivity</li></ul><h3>Product Quality Metrics</h3><h3>Mean time to failure</h3><ul><li>Time between failures</li><li>Mostly used with safety-critical systems such as traffic control systems</li></ul><h3>Defect Density</h3><ul><li>Measures the defects relative</li><li>As lines of code or function point</li><li>Measures code quality per unit</li><li>Used in many commercial software systems</li></ul><h3>Customer Problems</h3><ul><li>Measures the problems that customers encounter</li><li>Customer’s perspective towards the problem space</li><li>Non-defect-oriented problems together with the defect problems</li></ul><h3>Customer Satisfaction</h3><ul><li>Often measured by customer survey data through the five-point scale</li></ul><h3>In-process Quality Metrics</h3><h3>Defect density-dring machine testing</h3><ul><li>number of defects confirmed in software during a specific period</li></ul><h3>Defective arrival pattern during machine testing</h3><ul><li>Overall defect density during testing</li></ul><h3>Phase-based defect removal pattern</h3><ul><li>Defects at all phases of the development cycle</li></ul><h3>Defect removal effectiveness</h3><ul><li>Percentage of defects removed</li></ul><h3>Maintenance Quality Metrics</h3><ul><li>Fix backlog and backlog management index</li><li>a simple count of reported problems that remain</li><li>Fix response time and responsiveness</li><li>The mean time of all problems from open to closed</li><li>Percent delinquent fixes</li><li>Each fix, turn-around time greatly exceeds, classified as delinquent</li><li>Delinquent fixes</li><li>Refers to fixes that are not completed within the expected or required time frame</li><li>When fix turnaround time significantly exceeds the specified response time</li><li>Classified as delinquent</li><li>Impact customer satisfaction</li><li>Overall software quality</li><li>Monitoring metrics</li><li>Percent delinquent fixes help track the timeliness</li><li>responsiveness of the fix process</li></ul><h3>Software Quality Models</h3><ul><li>standard way of measuring a software product</li><li>McCall’s</li><li>Boehm’s</li><li>FURPS</li><li>IEEE</li><li>ISO 9126</li></ul><h3>McCall’s Software Quality Model</h3><ul><li>The first-ever quality model presented</li><li>Jim McCall in 1977</li><li>Called General Electronic Model</li><li>Set of the basic characteristics</li><li>Measure the quality of the product</li><li>Divide all software requirements into 11 software quality factors</li><li>11 Factors are grouped into 3 categories</li><li>Product Operation Factors: Reliability, correctness, Efficacy, integrity and usability criteria</li><li>Product revision factors: Maintainability, Flexibility, and testability</li><li>Product transition factors: Portability, Reusability, and interoperability</li></ul><h3>Boehm’s Quality Model</h3><ul><li>Gives more attributes and characteristics of the product than McCall quality model</li><li>Barry W. Boehm in 1978</li><li>Boehm’s and McCall’s are similar to some extent</li><li>The differences between these two models are:</li><li>McCall’s mainly centres on the accurate measurement of high-level characteristics As is utility</li><li>Boehm’s quality depends on a broader range of characteristics, including extended and detailed primary maintenance</li></ul><h3>FURPS Quality Model</h3><ul><li>Presented after McCall’s and Boehm’s models</li><li>Presented by Robert Grady and Hewlett-Packard Co.</li><li>Abbreviation of the word FURPS</li><li>Functionality</li><li>Usability</li><li>Reliability</li><li>Performance</li><li>Supportability</li></ul><h3>IEEE Quality Model</h3><ul><li>Presented many standards of software quality assurance and verification and validation of the software product</li><li>It depicts several ways for the measurements</li><li>Efficiency</li><li>Functionality</li><li>Maintainability</li><li>Portability</li><li>Reliability</li><li>Usability</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1704ebee5daa" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Demystifying UML: A Comprehensive Guide to Unified Modeling Language]]></title>
            <link>https://medium.com/@Programmer-RD-AI/demystifying-uml-a-comprehensive-guide-to-unified-modeling-language-b760b52860c0?source=rss-856efb321f48------2</link>
            <guid isPermaLink="false">https://medium.com/p/b760b52860c0</guid>
            <category><![CDATA[uml]]></category>
            <category><![CDATA[computer-science]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[uml-diagrams]]></category>
            <category><![CDATA[software-development]]></category>
            <dc:creator><![CDATA[Ranuga Disansa]]></dc:creator>
            <pubDate>Tue, 14 May 2024 09:19:16 GMT</pubDate>
            <atom:updated>2024-05-14T09:19:16.574Z</atom:updated>
            <content:encoded><![CDATA[<h3>Introduction to UML</h3><ul><li>Graphical language used to visualize, construct and document software systems, simplifying the software design process</li></ul><h3>What is a Model?</h3><ul><li>Provides blueprint of the system</li></ul><h3>What is the UML Model?</h3><ul><li>Represent systems at distinct levels in details</li><li>Contain model elements such as actors, use cases, classes and packages and one or more diagrams</li><li>Show a particular view of a system</li></ul><h3>Why UML for Modelling?</h3><ul><li>Graphical notation to communicate more clearly than natural language, too detailed</li><li>Overall view of the system</li><li>Independent</li><li>Movies us to fragmentation to standardisation</li><li>Simplifies the social process</li><li>Supports object-oriented concepts</li><li>Not only for developers but for business users, common people</li></ul><h3>Conceptual Model in UML</h3><ul><li>Defined as a model which is made for concepts and their relationship</li><li>The first step before drawing the UML diagram</li><li>high-level representation of a system or a part of a system that captures its essential concepts and relationships</li><li>bridge between stakeholders and the technical aspects of software development</li><li>Helps understand the real world.</li><li>How they interact with each other</li><li>Major Elements:</li><li>UML building blocks</li><li>Rules to connect the blocks</li><li>Common mechanisms of UML</li></ul><h3>Object-Oriented Concepts in UML</h3><ul><li>Objects: Represents the entity, basic building block</li><li>Class: blueprint of an object</li><li>Abstraction: Represents the behaviour of the real-world entity</li><li>Encapsulation: Mechanism of binding the data together and hiding them from the outside world</li><li>Inheritance: Making new classes from the existing ones</li><li>Polymorphism: Mechanisms for Existing in different forms</li></ul><h3>Benefits</h3><ul><li>Managed complexity</li><li>Improved quality</li><li>Increase reusability</li><li>Increased extensibility</li><li>Financial benefits</li></ul><h3>UML (Unified Modeling Language)</h3><ul><li>Describe the real-time systems; it is very important to make a conceptual model, proceed gradually</li><li>Major Elements:</li><li>UML building blocks</li><li>Rules to connect the blocks</li><li>Common mechanisms of UML</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/850/1*OK50kFNeBJQh8KNMHwPkwg.jpeg" /></figure><h3>UML Structural Things</h3><h3>Class</h3><ul><li>Objects having similar responsibilities</li><li>The class represented by a rectangle</li><li>Three sections:</li><li>In the top section, the name of the class</li><li>Middle section: class attributes</li><li>bottom section: operations of the class</li><li>Public: Visible from anywhere in the system +</li><li>Private: Visible only from within the class.</li><li>Protected: Visible from within the class and from the subclasses inherited.</li></ul><h3>Object</h3><ul><li>Represented as a rectangle with two sections</li><li>Top section: Name of the object instance and then the name of the class the instance is of</li><li>Bottom section: Rpresent the values: name = value</li><li>Sometimes represented with rounded rectangles</li></ul><h3>Interface</h3><ul><li>Set of operations, specify the responsibility of a class</li><li>Represented by a circle</li><li>The name, which is generally written below the circle,</li><li>Describe functionality without implementation</li></ul><h3>Use Case</h3><ul><li>Represented a set of actions performed by a system</li><li>Represented as an eclipse with a name inside it</li><li>Contain additional responsibilities</li></ul><h3>Actor</h3><ul><li>Defined as some internal or external entity that interacts with the system</li><li>Used in a use case diagram to describe the internal or external entities</li></ul><h3>Initial State Notation</h3><ul><li>Defined to show the start of a process</li><li>Used in almost all diagrams</li><li>Show the starting point of a process</li></ul><h3>Final State Notation</h3><ul><li>Used to show the end process</li><li>Used in all diagrams to describe the end</li><li>Show the termination point of a process</li></ul><h3>Component Notation</h3><ul><li>Shown in the following figure with a name inside</li><li>Additional elements may be added whether required</li><li>Represent any part of a system for which UML diagrams are made</li></ul><h3>Node Notation</h3><ul><li>Represented by a square box, as shown in the following name:</li><li>Physical component of the system</li><li>Represent the physical part of a system, such as the server, network, etc.</li></ul><h3>Interaction Notation</h3><ul><li>Message exchange between two UML components</li></ul><h3>State Machine Notation</h3><ul><li>Different states of a component in its life cycle</li></ul><h3>Package Notation</h3><ul><li>Used to wrap the components of a system</li></ul><h3>Relationships</h3><h3>Dependency</h3><ul><li>Describes the dependent elements and the direction of the dependency</li><li>Represented by a dotted arrow,</li><li>the arrowhead represents the independent electron</li><li>the other end represents the dependent electron</li><li>Dependent → Independent</li><li>Used to represent the dependency between two elements of a system</li></ul><h3>Association</h3><ul><li>Describe how many elements there are</li><li>Represented by a dotted line with (without) arrows on both sides</li><li>Multiplicity is also mentioned at the ends</li><li>How many objects are associated with</li><li>Represents the relationship between two elements in a system</li></ul><h3>Generalization</h3><ul><li>Describes the inheritance relationship</li><li>Parent-child relationship</li><li>Represented by an arrow with a hollow arrowhead</li><li>One end represents the parent element, and the other end represents the child element</li><li>Used to describe parent-child relationship</li></ul><h3>UML Diagrams</h3><ul><li>Class Diagram</li><li>Object Diagram</li><li>Use case Diagram</li><li>Sequence Diagram</li><li>Collaboration Diagram</li><li>Activity Diagram</li><li>State Chart Diagram</li><li>Deployment Diagram</li><li>Component Diagram</li></ul><h3>Types of UML Modeling</h3><ul><li>Structural modelling: Static features of a system</li><li>Behavioral modelling: Interaction in the system</li><li>Architectural Modeling: Overall framework of the system</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b760b52860c0" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Unlocking the Power of System Modeling: From Concept to Execution]]></title>
            <link>https://medium.com/@Programmer-RD-AI/unlocking-the-power-of-system-modeling-from-concept-to-execution-b3881f6299ad?source=rss-856efb321f48------2</link>
            <guid isPermaLink="false">https://medium.com/p/b3881f6299ad</guid>
            <category><![CDATA[concept]]></category>
            <category><![CDATA[computer-science]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[system]]></category>
            <category><![CDATA[modeling]]></category>
            <dc:creator><![CDATA[Ranuga Disansa]]></dc:creator>
            <pubDate>Tue, 14 May 2024 09:16:59 GMT</pubDate>
            <atom:updated>2024-05-14T09:16:59.797Z</atom:updated>
            <content:encoded><![CDATA[<h3>System Modeling</h3><ul><li>Process of developing abstract models of a system</li><li>Each model presents a different view of the perspective of the system</li><li>Represent a system using a graphical notation</li><li>E.g.: Unified Modeling Language (UML)</li><li>It helps the analyst understand the functionality of the system and models are used to communicate with customers</li></ul><h3>Types</h3><ul><li>Context models</li><li>Interaction models</li><li>Structural models</li><li>Behavioural models</li><li>Model-driven engineering</li></ul><h3>System Perspectives</h3><ul><li>Context Perspective</li><li>context or environment of the system</li><li>Interaction perspective</li><li>Interactions between a system and its environment or components</li><li>Structued prespective</li><li>Organization of a system or structure of the data</li><li>Behavioural perspective</li><li>Dynamic behaviour of the system</li><li>how to respond to events</li></ul><h3>Why use graphical models?</h3><ul><li>Facilitating discussion about an existing or proposed system</li><li>Incomplete and incorrect models OK, their role is to support discussion</li><li>Way of documenting an existing system</li><li>Accurate representation of the system should not be compromised</li><li>detailed system description used to generate a system implementation</li><li>Both correct and complete</li></ul><h3>UML Diagram Types</h3><ul><li>Activity Diagrams: Activities involved in a process or data processing</li><li>Use Case Diagrams: Interactions between a system and its environment</li><li>Sequence diagrams: Show interactions between actors and the system</li><li>Class diagrams: show the object classes in the system and the associations between these classes</li><li>State Diagrams: How the system reacts to internal and external events</li></ul><h3>Context Models</h3><ul><li>Used to illustrate the operational context of a system</li><li>What lies outside the system’s boundaries?</li><li>Social and organisational concerns may affect decisions on system boundaries</li><li>Architectural models, systems and their relationships with other systems</li></ul><h3>Process perspective</h3><ul><li>Show the other systems in the environment, not how the system</li><li>Developed and used in that environment</li><li>Reveal how the system being developed is used in broader business processes</li><li>UML activity diagrams, used to define business process models</li></ul><h3>Interaction Models</h3><ul><li>It is important as it helps identify user requirements</li><li>System-to-system interaction raises communication problems that may arise</li><li>It helps us understand if a proposed system structure is likely to deliver the required system performance &amp; dependability</li><li>Use case diagrams and sequence diagrams, used for interaction modelling</li></ul><h3>Use case modeling</h3><ul><li>Developed originally to support requirements elicitation, it is now incorporated into the UML</li><li>Each use case is a discrete task that involves external interaction with a system</li><li>Actors: people or other systems</li><li>Represented diagrammatically, provide an overview of the use case in a more detailed textual form</li></ul><h3>Transfer data use case</h3><p>Actors Medical receptionists, Patient record systems Description Receptionists may transfer data from MHC PMS to the general patient record database to maintain a health authority. Data Patient’s personal information, treatment summary Stimulus Patients information Response Confirmation that PRS has been updated COMMENTS receptionist must have appropriate security permissions to access the information</p><h3>Use Case</h3><h3>Sequence Diagrams</h3><ul><li>Part of the UML</li><li>Used to model the interactions between the actors and the objects</li><li>Shows the sequence of interactions</li><li>During a particular use case of use case instance</li><li>Objects and actors involved are listed along the top of the diagram</li><li>a dotted line is drawn vertically from these</li><li>Interactions indicated by annotated arrows</li></ul><h3>Structured models</h3><ul><li>Software displays the organization of a system</li><li>Terms of the components and their relationships</li><li>Static models: show the structure of the system design</li><li>Static models are akin to looking at a blueprint of a building, where you see how things are arranged but not how they operate in real-time.</li><li>Dynamic models: show the organization of the system when it is executing</li><li>Dynamic models are like watching a simulation of how the building operates when people move through it, showing how different parts of the building are used over time.</li><li>Structural models: discussing and designing the system architecture</li></ul><h3>Class diagrams</h3><ul><li>Used when developing an object-oriented system</li><li>Show the classes in a system</li><li>Associations between the classes</li><li>This can be thought of as a general definition</li><li>An association is a link between classes; there are some relationships between these classes</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/688/1*gNoNMDpPFXlPwvOq3sa1zw.png" /></figure><h3>Generalization</h3><ul><li>Everyday techniques that we use to manage complexity</li><li>Attributes and operations associated with higher-level classes are also associated with lower-level classes</li><li>Lower-level classes are subclasses that inherit attributes and operations from superclasses. Lower-level class, more specific attributes and operations</li></ul><h3>Behavioural models</h3><ul><li>Dynamic behaviour of a system as it is executing</li><li>What happens or what is supposed to happen, responds to a stimulus from its environment</li><li>Stimuli are of two types:</li><li>Some data arrives and is processed by the systems</li><li>Events: Events happen that trigger system processing and may have associated data</li></ul><h3>Model-driven engineering</h3><ul><li>approach to software development where models rather than programs are the principal outputs of the development process</li><li>Execute on a hardware-software platform, generated automatically from the models</li><li>Proponents of MDE: raise the level of abstraction in software engineering; engineers no longer have to be concerned with programming language details; specify execution platforms</li><li>Approaches to software development in which a system is represented as a set of models that can be automatically transformed into executable code</li></ul><h3>Usage of Model-Driven Engineering</h3><ul><li>Still at an early stage of development</li><li>It is unclear whether or not it will have a significant effect on software engineering practice</li></ul><h3>Pros</h3><ul><li>Considered at higher levels of abstraction</li><li>Generating code automatically</li></ul><h3>Cons</h3><ul><li>Not necessarily right for implementation</li><li>Savings from generating code may be outweighed by the costs of developing translators for new platforms</li></ul><h3>Key Points</h3><ul><li>A model is an abstract view of a system that ignores system details</li><li>Developed to show the system’s context, interactions, structure and behaviour</li><li>Show how a system that is being modeled is positioned in an environment with other systems and processes</li><li>Used to describe the interactions between users and systems in the system being designed</li><li>Use cases: describe interactions between a system and external actors;</li><li>Sequence diagrams: Add more information to these by showing interactions between system objects</li><li>Class diagrams: Define the static structure of classes in a system and their associations</li><li>Behavioral models: Describe the dynamic behaviour of an executing system</li><li>Modeled from the perspective of the data processed by the system or stimulate responses from a system</li><li>Activity diagrams: used to model the processing of data, activity represents one process step</li><li>State diagrams: model a system’s behaviour in response to internal or external events</li><li>Model-driven engineering is an approach to software development in which a system is reconstructed as a set of models that are automatically transformed into executable data</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b3881f6299ad" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>