Never underestimate the power of Passion!

Showing posts with label Automata. Show all posts
Showing posts with label Automata. Show all posts

Tuesday, 25 April 2017

On 05:49 by Vardan Kumar in , ,    2 comments
Automation-Analysis

Software Development-Role of Automation in analysis phase

What is Automation and why it should be performed?

Well, automation is any technique introduced to let our machine perform some task without any manual intervention or some manual intervention can be used if it is semi-automation. Machine can perform the task through a script , a code or an application depending on the requirement.

For Example

Writing a code that would perform repetitive database operations as in suppose inserting a large amount of data in database through an excel workbook. This kind of task can be so tedious when trying to do manually.

Why it should be performed?


  • In today's world time is money, you got it right definitely to save some of  those intense man hours, an automation process can be introduced.
  • Learning is the key: Well while in analysis phase of a software development life cycle, a lot of documentation is required, the data capture if done manually could not add much your skill set, but writing some script or code to automate the documentation process would add a lot to your skills.
  • Make your work interesting: Imagine, what if you spend your working hours capturing data in excel workbook, well sounds really boring, right! Letting your code do the same would definitely save those boring hours.
When Automation should not be done?

It is not always advised to automate the work, Whenever your work is not repetitive and building some code or script may take more time than your work, don't go for automation off course.

Analysis Phase in Software development Life cycle:

Analysis is one of the most important phase in any software development life cycle. A lot of documentation is required in this phase. Analysis could be any as in impact analysis on source files for a particular change orders, fetching dependencies or selecting some data from database as in describing tables etc. .

Instead of spending lot of hours digging your eyes into the computer screen it is better to write a code once according to your requirement and let your code do the rest.

Doing this will ensure accuracy, if all scenarios are taken care of off course, add a lot to your logic building skills as well as skill set and also if you are a part of a major project you can share your application with your team mates. This will eventually get you more rating bands off course.

Let us discuss some scenarios where automation can play a crucial role in the analysis phase of the software development life cycle....

Automation software
Automation Analysis


Scenarios

  • Suppose you are a part of a major project in which a certain identifier's name is required to be changed and you or your team are required to prepare an impact analysis document where you have to capture the source files or the part of project's code being impacted with that identifier and main thing you have thousands of source files that are need to be traversed. Now what would you do
    • Either spend those boring hours, opening your source files and count the number of occurrences of that identifier if any and capture it an excel workbook.
    • Or write a code once and let your machine generate impact analysis document for you.
    • Code could be any, a small c# windows form application would do or a small shell script can serve the purpose
  • Let us consider another scenario, suppose you have a list of  hundreds or thousands of database tables for which you have to capture number of records corresponding to a table along with all its column alongside their data types in an excel workbook, what would you do.
    • Either connect to database, describe each and every table, capture columns alongside its datatype for the same and select count(*) from table_name.
    • Or provide list of tables in a flat file and let your code process on each and every table one by one and capture the required data for you in an excel workbook for the same.
    • Use of system tables in a small c# application would solve the purpose.
  • Let us consider one more scenario, suppose you are to capture relative path of a file in which a particular identifier is being referred to in your your local directory or a sub-directory.
    • Now doing it manually capturing data or path could be tedious and kind of a good for nothing task.
    • Building an application that would capture path along side file name for you sounds quite interesting and a productive task.

There are a lot more scenarios that no one can imagine of. Doing such automation could be productive upto a great extent, its just the matter of choice.

Wednesday, 8 April 2015

On 13:01 by Vardan Kumar in    No comments
Automata-Introduction

INTRODUCTION TO AUTOMATA THEORY


Before we begin let me put some light on ABSTRACT MACHINES.
An Abstract Machine is the theoretical model of basic computer attributes,more specifically computer hardware or software.These Abstract machines functions on the concept of Discrete Times.
Discrete time visualize the value of the entity occurring at discrete(distinct)places in time.Abstract

Machines had all the capabilities of present computers,more precisely what they could compute.These abstract machines became the basis of Turing's study.Turing's purpose was to define a boundary  of what a machine could compute and what not.

Finite Automata(simpler machines) were studied by number of computer scientists proved to be useful in number of purposes.The formal grammar studied bt N Chomsky served the basis for various software components and important parts of compiler especially Lexical Analyzer.

Later S.Cook was able to take Turing's concept to the goal.He was able to distinguish between the problems that a computer could solve efficiently and the problems that could be solve in a principle but could consume a lot of time.These problems are referred to as intractable problems.

These developments in theoretical computer science enable us perceive what we can expect from software.Well the theory of intractable problems help us to judge the approach of problem solving i.e. whether we have to approach a certain problem head-on or we have to write a program to solve it(as it does not belong to intractable class) or we have to find another way or heuristic to counter a intractable problem so that we could limit the amount of time computer spend on solving such kind of problem.

THE FINITE AUTOMATA

These are a useful model for various kinds of computer software and hardware.Some of the important uses are :-

1. Software for designing and testing the behavior of digital components.

2. Software for searching large texts,such as collection of web pages, to figure out the            occurrences of words,phrases,any sequence or patterns.

3.Software for testing all systems that have finite number of discrete states(Since it is finite automata),such as communication protocols,protocols for security purpose i.e.to ensure secure exchange of information.

4.The lexical analyzer of a typical compiler also examples the use of finite automata.

Lexical Analyzer is that part of a compiler which breaks the text into logical units such as identifiers,keywords and punctuation.

The above systems may be seen as being in one state at all times in a finite set of states.


Still thinking what's the use in developing such kind of theoretical concepts..............Let just summarize the utility of the above concept.

Well this theoretical part of computer science makes us develop the art of designing machines.
As we know we got finite number of states(The utility of state is to remember the relevant part of computer or process history) hence finite remembering capability,hence a machine should be designed very carefully in such a way that it just remembers what is important ad forget what is not.

Now the question arises why we use only finite number of states?we can have as many states as we want then whats the fun in using finite states.....

Answer to this is.......By using a fixed and finite number of states we can run a system with a fixed set of resources. 

Have a look at this example..........
AUTOMATA INTRODUCTION
A FINITE AUTOMATA MODELLING ON/OFF SWITCH





The above example models a finite automaton of an on/off switch.Here we've got only one switch.The system need to remember the current state i.e. whether the switch is on or off and perform the opposite of the current state whenever the switched is pushed.

The system goes on as follows:-

  1. Initially the system is in 'OFF' state,when the switch is pressed it transits to 'ON' state.
  2. Now when the system is in 'ON' state and again the switch is pushed it transits back to 'OFF' state.

This is the simple case of finite automaton as remembering the current behavior or current state is quite easy.But sometimes its really complex to remember the behavior associated with system.

Let us view another example.......


Automata-Lexical Analyzer
A finite automata modelling acceptance of  keyword by lexical analyzer



The above example depicts how a lexical analyzer recognizes a keyword.Here in this example keyword'else' is recognized.

This automaton needs five states to work on,each state representss a checkpoint or a position in the keyword that has been reached so far.

The system works on as follows:-
  1. The system starts with an empty string.
  2.  Lexical Analyzer is imagined to compile each character one by one.
  3. The input character along with previous state character is remembered at each and every state as the system progresses.
  4. Since it is the work of automaton to check when the desired keyword is fully processed and make that state the accepting state.

Hence automata is essential for resolving following two big issues in the field of computer science:-

1. DECIDABILITY:-

This addresses what a computer can do actually.The problems which can be resolved by computer are referred to as 'decidable' 


2.INTRACTABILITY;-

This addresses what a computer can do efficiently.The problems that can be faced by computer head on or in finite or certain period of time with respect to the input are referred to a 'tractable'.

This was a Introduction to Automata Theory.........