Category Archives: Software Engineering

Edge Computing

Edge Computing takes distributed computing close to the information source, rather than relying on centralized data centers. This approach is relatively popular for systems that involve IOT devices.

edge-computing-use-cases-iot
https://innovationatwork.ieee.org/real-life-edge-computing-use-cases/

The idea is to keep computation near to source, to reduce latency. Decisions can be made faster as data does not need to be sent to long distance. This also reduce the amount of data sent to central servers as some level of data filtering and analysis is pre-processed at edge locations.

Edge Computing architecture usually contains following components

  • Edge devices: Devices that collect data from sensors, cameras, and other sources. Examples include IoT devices, cameras, and industrial equipment.
  • Edge gateway: An edge gateway acts as a bridge between the edge devices and the back-end systems.
  • Edge server: This is a server located at the edge of the network that is responsible for processing and analyzing data. It can run applications and services that are optimized for low-latency and high-performance requirements.
  • Fog nodes: These are intermediate devices that sit between the edge devices and the cloud or data center. They are responsible for processing and analyzing data, similar to edge servers, but they are typically more powerful and capable of running more complex applications and services.
  • Cloud/Data center: The data that is processed at the edge is then sent to a cloud or data center for further analysis, storage and sharing.
  • Management and orchestration platform: This is a platform that manages and monitors the edge devices, gateways and servers, and allows for the deployment, configuration, and management of edge applications and services.

Design for Accessibility – 2

In the last post, I introduced the concept of accessibility, here I will discuss more on testing your application for accessibility. The good thing is that we have many tools that can help us with basic accessibility testing.

The first level of testing that you would like to do for accessibility would be for Keyboard navigation (does your application support tab/ arrow navigation) and Screen reader. All Operating systems come with inbuilt support for screen readers Windows has Narrator, Mac has VoiceOver, and there are readers like JAWS and NVDA.

Additionally, there are tools to help with accessibility testing, some of the common ones are following

Chromium Developer Tools: Chromium has inbuilt support for checking for accessibility and generating reports for a page. Refer https://developer.chrome.com/docs/devtools/accessibility/reference/

Accessibility insights: Another tool that can help with testing and generating a detailed report for an application. Refer https://accessibilityinsights.io/. It gives not only details but also suggestions on fixes. Here is a sample report

Report generated by Accessibility Insights
https://techblog.topdesk.com/accessibility/testing-accessibility-with-accessibility-insights/

Additional Tools Worth Exploring

Design for Accessibility – 1

As a software developer/ designer/ architect, when you think about software, there are many non-functional aspects of the software that you need to take care of. Accessibility is one such important non-functional aspect, which can get neglected if you are not paying attention.

Before getting into more details, let’s try to understand what accessibility is –

Accessibility enables people with disabilities to perceive, understand, navigate, interact with, and contribute to the web. 

https://medium.com/salesforce-ux/7-things-every-designer-needs-to-know-about-accessibility-64f105f0881b

Four core Accessibility principles – Perceivable, Operable, Understandable, and Robust.

Information about accessibility testing and compliance
https://www.pqatesting.com/2020/10/26/your-accessibility-testing-cheat-sheet/

WCAG or Web Content Accessibility Guidelines, current version 2.1 gives us a detailed idea of areas one needs to consider when working on the accessibility of a website.

Refer: https://www.w3.org/TR/WCAG21/#intro

WCAG 2.1 gives three levels of conformance A, AA, or AAA

WCAG diagram showing overall structure, with principles in the far left column, guidelines in the adjacent column, and success criteria numbers across the following three columns, A, AA and AAA.
https://openclassrooms.com/en/courses/6663451-make-your-web-content-accessible/6912083-get-to-know-the-web-content-accessibility-guidelines-wcag

WAI-ARIA: Web Accessibility Initiative – Accessible Rich Internet Applications or WAI-ARIA is a specification developed by W3C in 2008.

WAI-ARIA, the Accessible Rich Internet Applications Suite, defines a way to make Web content and Web applications more accessible to people with disabilities. It especially helps with dynamic content and advanced user interface controls developed with HTML, JavaScript, and related technologies. 

https://www.w3.org/WAI/standards-guidelines/aria/

Further Readings

Jmeter- Record and Play test cases

In my last post I talked about record part of test case in Jmeter.

Next step is to run the test cases, this is relevant even if you have created test cases manually. The first thing we need to add for any test plan is Thread Group.

Right Click on Test plan->Add-> Threads -> Thread Group

You can create test cases manually or record within Jmeter. A basic tool for providing the result data is Summary Report

Thread Group->Add-> Listener->Summary Report

There are additional reporting tools which can be used like Response Time Graph, Graph result etc.

By default the test will execute only once, but this is configurable in Thread Group properties.

Jmeter2

You can see I have set users, rampup and loop as 5.

Number of threads or user will simulate number of users hitting the application simultaneously.

Rampup period will give time it takes for the peak load. For example you have set number of user as 1000, and ramp up period as 100 seconds, Jmeter will start with 1 (or more) user at second one and will increase load gradually. At 100th second, load will get raised to 1000 users.

Loop 1 means that all users will hit the application URL only once. a higher value, say 10 means each user hits the application 10 times. so 1000 users with loop of 10 means a total of 10000 hits on URL.

Once the test completes, we can see results in Summary report or other graphs

Recording Test cases in Jmeter

Recording of web pages for performance testing is straight forward in Jmeter

Open a new Jmeter Test Plan (opens up by default for new setup), this will have Test Plan and WorkBench options by default in the left tree.

Follow these steps to setup the recording
Step 1: Right Click on Test plan->Add-> Threads -> Thread Group
Step 2: Thread Group->Add->Config Elements-> HTTP Request Defaults

Step 3: Now under Workbench-> Add-> Non Test Elements-> HTTP(S) Test Script Recorder
Step 4: (Optional to view requests) HTTP(S) Test Script Recorder -> Add Listener- > View Tree Listener

So far we have just added elements and not done any configuration setting. For recording purpose, we need to configure some values in HTTP(S) Test Script Recorder

jmeter

Port is required to be set to record the browser activity. HTTPS Domains setting is required if we are trying to record HTTPS pages, as I am not doing it here so this is left blank. URL patterns to include and exclude can be set for specific patterns to be recorded.

For this test I only set Port number. The same port number needs to be set in proxy setting for browser from which we are recording the test cases. Click on start button in Recorder and set the proxy setting in browser. For example, in Firefox go to Options->Advanced->Network->Connection-Settings->Manual Proxy Configuration->Http proxy= localhost and Port same as set in Recorder.

And now we are done. Whatever you will browse, will automatically get recorded in Jmeter.

Difference between web server and application server

We  use terms application server and web server interchangeably these days. Historically a web server was supposed to serve static html pages over http protocol. Then web servers started serving scripting languages like ASP, JSP, PHP etc. For complex application which needed services connection pooling, object pooling, messaging, transaction management were supposed to use application server.

I said historically because with time the distinguishing line has narrowed down. Most of the web servers have started providing features of application servers with plugins and add-ons. Some exmples of web servers- Apache HTTP (PHP), Tomcat (Servlet container, newer versions have EJB container) etc. Application server examples are JBoss, Websphere etc.

Complex Event Processing

Let’s start from understanding what is an event. The dictionary explains events as “a thing that happens, of importance”. Second part, i.e. “of importance” is a bit tricky, some events can be important for one but not for another. For example clicking anywhere on your computer screen is actually an event, but it does not result into an action, but clicking on some icon is event of importance as that will open up some application. In a banking system an event will be when someone withdraws money, checks balance, closes account or open account etc. In a computer game there will other type of event like, jump, run, hit, kill, fire etc.

Event processing is what should be done when the event occurs. For example, what to do when a specific icon on a window is clicked? What should be done when an event of withdraw money occurs – check if pin/ signature is correct, check if there is sufficient balance, pay money to person, reduce the amount from balance etc.

Now next level is to handle complex events. A complex event is an event which is result of many events occurring in relation to each other forming a definite pattern.

We are receiving following information from a ground
1. A man is kicking a football.
2. There are 2 goal posts set on opposite ends of ground.
3. There are few men in the ground trying to take control of same ball.

We can deduce a complex event – a football match.

This kind of pattern detection and complex event processing is used in Operational Intelligence solutions to identify opportunities and threats. For example banks use this kind of event processing to detect and take action on fraud detection. Say if a credit card transaction seems out of place, the amount deducted is not supported by historical data about the card usage, or the card is being used too frequently or the card is used at a location which is not in proximity of the consumer address, this kind of events, combination can generate an event for “CheckCreditCardFraud” or “StopPayment” or “RaiseAlert”.

Understanding Open/Closed Principle

Open closed principle is an important rule in software design, which we need to follow when designing a software system. It states “A Software code should be open for extension but closed for modification”.

What does that mean? Let’s take a very simple example from day to day life. We all use TV remotes. Say, we have created a very simple software code for remote operations like on/ off, vol increase/ decrease, channel change etc. Now what should be my design considerations

1. Any one should be able to extend the code to add new functionality, for example, for advanced TV’s one should be able to add functionality for subtitle language selection, operator specific options etc.
2. At the same time I need to make sure that no one should be able to alter existing core functionality like vol increase/ decrease, so that it does not break down the functions which are working fine perfectly.

Point 1 is what we say open for extension and point 2 states closed for modification principle. The open/ closed principle helps maintainability of code perfectly, by making sure we do not break what is working fine with flexibility of adding new features at the same time.