Download as pdf
Download as pdf
You are on page 1of 53
it s! a area by analyzing the known properties of Lecture No. 24 8.7 Architectural models Like analysis models, many different kinds of architectural models are developed duri the architectural design process. Se eed arn f bie Cowling. process and 10 i 2 cone and improving es relatively uniform code throughout the application or project. As a number of programmers participate in developing a large piece of code, it is important that a ‘consistent style is adopted and used by all. Therefore, each organization should develop a style guide to be adopted by its entire team. This coding style guide emphasizes on C++ and Java but the concepts are applicable to other languages as well 10,3 Naming Conventions is ‘convention that includes information about the variable in its name (su type, whether itis a reference variable or a constant variable, et). Every compared programmer seems to have their own flavor of Hungarian Notation. The advantage of Hungarian notation is that by just looking at the variable name, one gets all the information needed about that variable. Bicapitalization or camel case (frequently written CamelCase) isthe practice of writing ‘compound words or phrases where the terms are joined without spaces, and every term is, capitalized, The name comes from a supposed resemblance between the bumpy outline of te comet option STs - Indentation I ‘than 4 makes deeply nested code difficult to read and inerease the chance tht the lines must be spit. Choosing between indentation of 2,3 and 4,2 and 4are the more common, and 2 chosen to reduce the chance of spliting code lines, Natural form for expression Expression should be written as if they ate written as comments oF spoken out aloud Conditional expression with negation ate always difficult to understand, AS an example consider the following code: (4 (bloske~ unblocks)) n((bloek>sactiveBIoek) | (blockId < unblocks)) Parenthesize to remove ambiguity ‘system, This 15 done in terms of a Set of messages exchanged among a set of objects ‘within a context to accomplish a purpose, This is often used to model the way a use case is realized through a sequence of messages between objects, The purpose of Interaction diagrams i to ‘© Model interactions between objects Assist in understanding how a system (a use ease) actually works ‘© Verify that a use ease description can be supported by the existing classes Identify responsibilities/operations and assign them to classes UML provides two different mechanisms to document the dynamic behaviour of the system, These are sequenee diagrams which’ provide'ta “time-based view! and Collaboration Diagrams which provide an organization-based view of the system's dynamics. The Sequence Diagram Lotus frst lok at Sequence Diagrams. These diagrams iustrate how objects imercts with each ote and emphasize ime ordering of messages by showing objet infractions ranged in time sequence, These ean be used model simple sequential ow, bracing tration, resin and congue, The fous af sequecedlagans on Tuebonaiy. The objec are organized m4 honionial line and the evens ta ver=\ fess NeMea se (C8504-Software En Lecture No. 32 10.9 Clarity through modularity As mentioned earlier, abstraction and encapsulation are two important tools that ean help -omplexity of a program. We also discussed that these! ‘zeneral, as the function becomes longer in to understand. Modularity is a too! that ean help us in reducing the size of individual functions, making them more readable. As an example, consider the following selection sont funetion (€$504-Software Engineering Lecture No. 34 1013 Portability Many applications noed tobe ported on to many different platforms. AS we have seen, i is prety hard to write error fee, efficient, and maintainable software. So, #iaimgjOn Drobably nor come ats low" eost So, we ought to find ways and means by which we can port applications to other platforms with minimum effort, The key to this les in how we ‘write our program. If we re careful during writing code, we can make it portable. On the other hand if we write code without portability in mind, we may end-up with a code that {s extremely hard to port wo other environment Following is bret guideline that ean help 1g vendor specific language extensions, use STL. as much as standard docs not require function prototypes, one should always write hole saroubey,—_/ ANSL—the pt approach vary ffom one machine tothe Software Verification and Validation 11.1 Software Testing To understand the concept of software testing correctly, we need to understand a few related concep Software verification and validation ‘Verification and validation ae the processes in which we check a product against its specications andthe expectations of the users who will be using it, According toa known software engineering expert Berry Boehm, verification and validation are Verification * Does the product meet system specifications? «Have you bul the product righ? Validation «Does the product meet user expectations? «Haye you bul the right product? Ivis possible that a software application may fulfil its specifications but it may deviate fiom users expectations or thei desired behavior, That means, soware i verified but not validated. How iit posible? It's possible because during the requirements engineering Phase, user needs might not have been eaprred precisely or the analyst might have Iugsed a major sakeholer inthe analysis, Therefore ii potato verify as well as ON Eo EN Re Reena oy Cer According to UML. 1 3, a system is a collection of connected units that are organized to accomplish a specific purpose. A system can be described by one or more models, possibly from different viewpoints. IEEE Std. 610.12-1990 defines a system as a collection of components organized to accomplish a specific Function or set of functio That is, a system is defined as an organized set of connected components to accomplish the specified tasks, Let us now look at some of the software architecture definitions from some of the most influential writers and groups in te field Software Architecture Definitions ML 1.3: ‘Adsison.Wostey 1997: 2 companion “item description” abject (association). Fora composite object, include object connections to its “part” object (aggregation). 8. For all objects (including all of the above) select connecting objects to which the object under consideration sends a message (within one or more scenarios) to get some information of to answer a query about objects directly related to it ‘The third and last step in establishing each object’s responsibility is to define what Serves des each object inthe problem domain provide, ie, what it does. Puting the Tight service with the Fight object i also very important since any mistake in judgment will increase coupling and reduce cohesion. The verbs in your problem domain utally indicate some ofthe servies required o the asociated object. Software abjects do things that the system is esponsile todo with regard to that object By putting the services with the attributes they work on results in lower coupling and stronger cohesion, and inereased likelihood of reuse. The basie principe isto keep data and action together for lower coupling and better eohesion, The basic services, done by all (such as get, set, create, initialize), are not shown in the object model. While or an objeet, the following Fundamental questions should be forti=0,)< aie FE santa) afmin Its easy to see thatthe new seletionSort function is much mote readable. The logical steps have been abstracted out into the wo functions namely, minimum and swap. This code is not only shorter but also as a by product we now have two funetions (minim and swap) that ean be reused ‘Reusabiity is one of the’ rime reasons to: make funetions ut is not the only reason “Modularity is of equal concer (if not more) and a function should be broken into smaller Pieces, even if those pieces are not reused. AS an example, let us consider the quickSort gor below ‘elements, ahd connecting elements, The data elements contain the information that is ‘used and transformed in the system; the processing elements process the data elements and specify the transformation functions, and connecting elements connect different picces of architecture together. These ean themselves be data or processing elements This formula was modified by Boehm as follows: Software architecture = (Elements, Forms, Rationale/Constaints} Krutchen proposed thatthe software architecture model should be composed of multiple views as a software architecture deals with abstraction, with decomposition and composition, with sive and esthetics as well as requicements fom diferent stake holders His architectural model is known as Krutchen's 4*1 architectural view model. As ial view is the object model of the design, the process view captures the concurrency and synchronization aspects of the design, the physical view documents the mappings) fof the software onto the hardware and reflects its distributed aspect, the development view describes the slate organization of the software in its development environment, and the usecase view uses selected use eases or scenarios to validate that the architecture Supports the required functionality “This model is shown in the following diagram, €8504-Software Engineering —L Lecture No. 35 10.14 Exception handling advantage of exception handling sits ability to handle asynchronous errors, The idea is to raise some error flag every time something goes wrong. There isa system that is always on the lookout for this ero flag, Third, the previous system cals the eror handling code if the eror flag has been spotted. The raising ofthe imaginary rzor lag is simpy called raising or shrowing an error. When an ercor is thrown the overall system responds by catching the error. Surrounding a block of error-senstive code with exception handling is called trying to execute a block. The following code segment ilusrates the genera exception handling mechanism. 10.10 Short circuiting || and && The logical and operator, &&, and logical or operators, |, ae special due tothe CIC short circuiting rule, ie. a | b and a && b are short eiccuit evaluated, That is, eful tool Itcan be used where one boolean expression ean be placed first to “guard” a potentially unsafe operation in a second boolean expresion ‘Also, time is saved in evaluation of complex expressions using operators | and && However, a numberof issues arse if prope attention is not paid. Let us lok at the following code segment taken from a commercially deve for a large intemational bank sarc Ne Node ns Node Correct ventions Weft (Stor tine: 1:02:48 AM, 3 saruory 2023) es904-sahworetngineeing-1(ltWae avention ot (storie: A 20 denny 3023) ovestion of Str tine:109137 At, 30 January 2023) es80¢-sotmaretnginenring- (aul aveton oS ene: N31 At, 39 Sensory 2682) ® rom TEIN ccns ess04- sonore tnginerng- (auf ovenions Wel 18 (Stor tine: 1:01:28 AM, 30 sensory 223) oventions #11 ( tr ine: 14:1 39 Jonvory 2023) vention 7 of Str ine ¥280:87 30 Jonsry 2023) moran TEAM eons soe sonore tnginering- (auf ventions Bol (ster tine:10:9098 AM 20 denser 2023) ® pEEANTIOAN.ce soe sotmoretnginerng- (a ovetions sot (tert tine: 088% Al, 38 Jonvary 2022) cssoe- sonore tnglneeing- (al DSAN SEND oveston 3 of (Str tine: 0:80:21 A. 30 Jonsory 2023) EARTIEAcen s804-sotaretnginering~ (ou aveston #101 stort te: 08:58:08 30 Jonvary 223) ‘Question #8 of15 (start ne: 04.0637, 30 Jonuary 2023) a ‘or woimporont as thathlpsin manoging he program cnsley, fatact ine carectoption eas a Lofolo] ‘Queton of 1 (str ime: €3:986 30 Jamwory 2023) O° O° O° ‘Quetion #1 of 18 (Str ime: 03:58 P30 January 2023) “Speaiatnoton means eter ne correct option 7 Gating te some mtnoa wth object cis bet ing toe te O° O° Oo etc the coment option cesurain mut-teades eppieatene replanted os operation col ® sro by doteaine rane ok coer elore eons OER Necest etaT een nes vrs ‘question 0 18 (Start ne 03:5208 PM, 30 Janae 2023 Conair the folowing atest nea: (Mic the ooning i comect es etc the comet option Bree ot verano ond re aaa ° etctis connote rian wi way ° “quvetion 908 start ime 03:8647 Pi, 30 Januar 2023) — sas risen ce 8 ol* onto eroraee @ ° ‘Qveton #8 of (str tine: 05:48:54 30 sory 2023) Ino ot See syste ne tam Payne epratense saact tne conet option Oo = 7 Forcpant Oo ‘eaton #705 (str time: 03:48:18 PM, 30 January 2023) orbecore a sondora neato for eet niente ytarmadelng, setet tne comast option A et (object Gensvattonguage) eo eo" a O° ‘Qveton a 8 (str ine: 03:4788 Pt, 30 January 2023) ‘Which eftheotasng acter arincides nb dsgn proces of @sotecrecrheecte. preteen correct option srentetue! Ante 09 Texing| oO Sto Sting and caer Decongoniion Reqaremant speteatons othe som J Sito Gavloprant ena eplyrent O° @ O° ‘Queton# 8 str ime: 03:48:80 PA, 30 denuary 2023) “Acar s mode up alo boy. teo ot cr whan aleesngmacharan, breaking mectonem anda pawerengin Tha chive dtarrt serve ce. eet the core option everson co O|@/|0o queen #4 of (Str tie: 03:48:74, 30 Jonuery 2023) Oo 8 racic Oo ‘queen #201 (stort te: 02:4236 Pu, 30 Jenvary 2022) ‘atk caved rom Moment Closed Morel ered om Aneel Coser. etc th corre option canned arate tincone ond gota @ Ve [atwainotbe abe to acces any clase @ ati cowes tw asces eniy tha armas ios ° ° ° ‘Queton# 10f1 (stot tne 084-026, 30Jenvery 2023) tent reise stem eae Seiet tne comet option O|O0O|/® GS504- Software Engineeting-1-Quiz 3 solution 2023 | CS504 Quiz 3 solution 2023 Cee ston tt atta 3 mer 8) ete © ~ GS504- Software Engineeting-1.Quiz 3 solution 2023 | CS504 Quiz 3 solution 2023 Cee eon at ttm aa mr) et GS504- Software Engineering-1.Quiz 3 solution 2023 | S504 Quiz 3 solution 2023 Cee ‘erent ne: 904487439 rey 388) Ez GS504- Software Engineeting-1.Quiz 3 solution 2023 | CS504 Quiz 3 solution 2023 Jeera GS504- Software Engineeting-1.Quiz 3 solution 2023 | CS504 Quiz 3 solution 2023 Cee ‘tena nett 40 8 sae) tests o C504 - Software Engineering-1 Quiz 3 solution Sater eLearn me MORI D4 Quiz 3 solution 2023 Peed Tae AS med ese AEM CAE) Senate een nessa eT ee SUM ‘enter 40 i 929483) rote M4 Software Engineering-1 Quiz 3 solution 2023 | CS504 Quiz 3 solution 2023 Sanat (stone ae a oN) ee foaena sete srt ses eso) “ee M4 - Software Engineering-1 Quiz 3 solution 2023 | CS504 Quiz 3 solution 2023 tena (tetine Rs8 S sr 2822) tot aac ron aa ea aoe olution 2023 | CS504 Quiz No.3 solution... @ 6 = [enn Re L ~ z| M4- Software Engineering -| (Quiz No. 3) Il CS504 SOLVED QUIZ NO 3 Tso} peed : > ae M4- Software Engineering -| (Quiz No. 3) Il CS504 SOLVED QUIZ NO 3 C8504 - Software Engineering - | (Quiz No. 3) || CS504 SOLVED QUIZ NO 3 PSC i Ma eI ese Te AOE Tso} M4- Software Engineering -| (Quiz No. 3) Il CS504 SOLVED QUIZ NO 3 PSC i Ma eI ese Te AOE c#84- ster oginigH(hn 3 Tso} PSC i Ma eI ese Te AOE (C8504 - Software Engineering - | (Quiz No. 3) || CS504 SOLVED QUIZ NO 3 M4 Software Engineering -| (Quiz No. 3) Il CS504 SOLVED QUIZ NO 3 yen : en a ® ye : en a CMa eT ners (008 3) uesantte srt 486747 38 ssny 2) restore:

You might also like