Thursday, May 25, 2017

Software Architectures - Second Semester 2014-15 : Mid-Semester Test (EC- 2 Regular)

Birla Institute of Technology & Science, Pilani
Work-Integrated Learning Programmes Division
Second Semester 2014-2015

Mid-Semester Test
(EC-2 Regular)

Course No.                     : SS ZG653  
Course Title                   : SOFTWARE ARCHITECTURES 
Nature of Exam             : Closed Book
Weightage                      : 35%
Duration                         : 2 Hours 
Date of Exam                 : 20/02/2015      (FN)

Q.1. A software system crashed 100 times in the first year and for each crash it needs 10 min to restart. Calculate the availability in percentage in that year.
                                                                                                                                 [4]
Answer:

In a year, total minutes is: 365 X 24 X 60 = 525600 min.
The system failed 100 times, and each time it took 10 min to restart.
Total time to recover: 100 X 10 = 1000 min.
Total time of operation: 525600 - 1000 = 524600 min.
Availability: (524600 / 525600 ) X 100 = 99.809 = 99.81%


Q.2. Consider a web portal built using J2EE based infrastructure. The system needs to be available 24x7 with small acceptable downtime. To ensure that the application is not choked with too many requests, you have decided to control the number of hits to this portal, if the number of hits exceeds a threshold. You have also decided to monitor the health of the server to ensure the availability. Identify at least 2 availability and 2 performance tactics that are suitable, and explain the reason in one line per tactic.    
                                                                                                                                 [8]




Answer: 

Availability tactics: 
1. (a) Ping or (b) heartbeat to detect if the application is live in order to take the mitigating action. 
2. (a) Active redundancy or (b) passive redundancy is necessary to start a good copy of the application if the main server goes down.
Since small acceptable downtime is allowed, it is not required to use expensive “Voting” mechanism. Depending on the downtime tolerance limit, one can go for either passive or active redundancy. “Spare-Copy” is not acceptable as it takes quite a bit of time to restart the service.

Performance tactics: 
1. Main tactic category: Reduce #of events: In this context it is the number of hits. 
      a) Manage event rate: Using this tactic it will be possible to either explicitly deny the service in a graceful manner if it exceeds threshold (by showing some user-friendly page) 
      b) Control sampling freq: Don’t even register the new request. 

 2. Main tactic category: Controlling resource usage 
     a) Bound exec time: Execution time of each request can be bounded so that it does not impact others 
     b) Bound queue size: Requests aren’t piled up beyond certain point. These are discarded if the queue is full.


Q.3. Propose the priority of quality attributes when considered for architecture and implementation for an Automated Teller Machine (ATM). Justify your choice of priority. Use Security, Testability, Availability, Modifiability, Performance, and Usability quality attributes.  
                                                                                                                                [5]
Answer: 

My choice of priority :  
1. Security
2. Availability
3. Usability
4. Performance
5. Modifiability
6. Testability

Justification: 
  • At all times the top three attributes form the important ones to be taken care of for an ATM. 
  • Security to make sure that the system is secure at all times as the data and transactions which the system manages could mean major loss to users if not handled correctly. 
  • Availability forms a key attribute (second to security) as this system will be used by users who would not like to spend more time at the ATM (rather an optimum time at ATM); additionally would need the system available 24 x 7 x 365. 
  • System needs to be simple as the class of users is anyone who is a bank account holder and thus system cannot assume any technical knowledge or a level apart from simple steps to make use of the ATM to complete transactions. (Usability)
  • Other attributes (Performance, Modifiability and Testability) lower in priority than the others. 
  • ATM steps for all transactions are typical and thus performance does not form a comparable attributes. 
  • Systems do not change as often hence modifiability and testability can be at the lowest priority.


Q.4. During architecture review it is found that the account management module invokes system logging through an intermediate component. The logging is done frequently. Identify at least two quality attributes that are +vely or –vely impacted by this approach. Explain the reason for each in one line.
                                                                                                                                [4]
Answer: 

Modifiability is impacted +vely. This is a clear example of using the tactic: Use of intermediary between modules to prevent ripple effect, when the logging component is changed or upgraded. 

Performance is impacted –vely. One common tactic to improve the performance is to reduce overhead – by removing the intermediaries. The given design clearly violates this tactic.


Q.5. What are the dependencies that need to be taken care to avoid ripple effect in modifiability tactics?
                                                                                                                                [8]
Answer: 

If Module A is changed to accomplish particular modification, then Module B is changed only because of change in Module A, B has to be modified because it depends, in some sense, on A. 
8 types :
     a.  Syntax 
              i.  Syntax of data: For B to compile (or execute) correctly, the type of the data that is 
                  produced by A and consumed by B must be consistent with the type of data assumed by B
             ii.  Syntax of service: For B to compile and execute correctly, the signature of services 
                  provided by A and invoked by B must be consistent with the assumption of B 
     b.  Semantic of 
              i.  Semantics of data: For B to execute correctly, the semantics of the data produced by A 
                  and consumed by B must be consistent with the assumptions of B
             ii.  Semantics of service: For B to execute correctly, the semantics of the service produced 
                  by A and used by B must be consistent with the assumptions of B
     c.  Sequence of 
              i.  Sequence of data: For B to execute correctly, it must receive the data produced by A in a
                  fixed sequence. Ex: a data packet’s header precede its body. 
             ii. Sequence of control: For B to execute correctly, A must have executed previously within 
                 certain timing constraints. Ex: A must have executed no longer than 5ms before B 
                 executes
     d.  Identity of an interface of A: A may have multiple interfaces. For B to compile and execute 
          correctly, the identity of the interface must be consistent with the assumptions of B 
     e.  Location of A (runtime): For B to execute correctly, the runtime location of A must be 
          consistent with the assumptions of B 
      f.  Quality of service/data provided by A: For B to execute correctly, some property involving 
           the  quality of the data or service provided by A must be consistent with the assumption of B.  
           Ex: data provided by a particular sensor must have a certain accuracy in order for the 
           algorithm of  B to work correctly. 
     g.  Existence of A: For B to execute correctly, A must exist. 
     h.  Resource behavior of A: For B to execute correctly, the resource behavior of A must be 
          consistent with B’s assumptions


Q.6. Identify at least three differentiating features with examples between “Architectural Pattern” and a “Design Pattern”. 
                                                                                                                                [3]
Answer : 

Architectural Pattern
Design Pattern
An architectural pattern is a highest level of Design of a system
A design pattern is a medium level of design of a system
An Architectural Pattern expresses a fundamental structural organization schema for a software system
A design pattern provides a scheme for refining the subsystems or components of a software system
It provides a set of predefined subsystems, specifies their responsibilities and includes and rules and guidelines for organizing relationships between them
It describes a commonly-recurring structure of communicating components that solves a general design problem within a particular context


Q.7. Describe essential aspects of Security. 
                                                                                                                                [3]
Answer : 

Three main aspects

1. Confidentiality : prevention of the unauthorized disclosure of information. E.g. Nobody except you should be able to access your income tax returns on an online tax-filing site.

2. Integrity : prevention of the unauthorized modification or deletion of information. E.g. your grade has not been changed since your instructor assigned it.

3. Availability : prevention of the unauthorized withholding of information – e.g. DoS attack should not prevent you from booking railway ticket


Other Important aspects of Security

Non repudiation ::
An activity (say a transaction) can’t be denied by any of the parties involved. E.g. you cannot deny ordering something from the Internet, or the merchant cannot disclaim getting your order. 

Assurance ::
Parties in an activities are assured to be who they purport to be. Typically done through authentication. E.g. if you get an email purporting to come from a bank, it is indeed from a bank. 

Auditing :: System tracks activities so that it can be reconstructed later

Authorization :: grants a user the privileges to perform a task. For example, an online banking system authorizes a legitimate user to access his account.

***********

No comments:

Post a Comment