Monday, December 10, 2018

All Important Facts That You should know About React

React is a Front-end JavaScript library which is developed by Facebook in 2011. It is a component-based library which helps to develop reusable UI components. It is widely used for developing interactive web and mobile applications

 Three main features of React

  1. Use Virtual DOM
  2. Use server-side rendering
  3. Follow unidirectional data flow
Virtual DOM is a copy of the real DOM at it can be considered as a lightweight JavaScript object. It is a node tree that contains elements and their attributes as an object and its properties. Virtual DOM works in three simple steps
  1. When the data change happen, the entire UI re-render in virtual DOM
  2. Calculate the difference between real and virtual DOM
  3. Real DOM will be updated according to the calculations


The major advantage of using React with comparing to other front-end libraries is that it can be conveniently used as both client and server sides. 

React use JSX (JavaScript XML) to implement elements because it is robust and improve the performance. But browser can't read the JSX because it is not an actual JavaScript object. Therefore we need a transformer to change JSX into a JavaScript object. (ex: Babel)

The following points summarize some of the recently used terms that you may use in React programming.

  • Props
Props mean properties. They are known as immutable which means read-only components. They behave in a unidirectional way which means they always passed down from parent component to child component and you can not pass it in reverse 
  • State
States are the source of data. They are mutable unlike props and when the state change using this.setState() method, component will be rerendered.

There are three phases in the component lifecycle
  1. Initial rendering phase: component is about to start and make it's the way to DOM
  2. Updating phase: when the state is changed component will re-render
  3. Unmounting phase: component is destroyed and removed from the DOM
There are seven different component lifecycle methods in React
  1. componentWillMount: execute just before rendering happen in both client and server side
  2. coponentDidMount: execute on client side after the first render
  3. componentWillRecieveProps: invoke when props are received from the parent class and before another render called
  4. shouldComponentUpdate: returns true or false based on the component update condition
  5. componentWillUpdate: call before rendering happen in DOM
  6. componentDidUpdate: call immediately after rendering happen
  7. componentWillUnmount: call after the component removed from DOM












Friday, June 24, 2016

Agile Engineering

Introduction


In this session we learnt about Agile Methodology, Scrum, Kanban and Scrumban techniques. First of all presenter tried to illustrate us how we follow processes in our day to day activities such as preparing for the exam. He said that we need a process when we have limited resources. Then he slowly came to the topic and he explained what are the different models or processes that can be used to develop software including waterfall model, RAD, Spiral etc. Then he illustrated some drawbacks of those models and then discussed Agile Methodology in very advance. The presentation had two parts, before the small break he covered all the details about agile methodology, advantages and about agile manifesto. And in next part he covered about Scrum, Kanban and Scrumban techniques. During the second part of the presentation we did some group activity. In that activity we prioritized features of a given scenario and build user stories for that each prioritize features. 

Knowledge Shared 


At the start the presenter illustrated us what is the process and how it related to out practical life. As an example he got the way we prepare for the exam and he said that we follow various processes in our day to day activities. And then he described about other software development methods including Waterfall Model, RAD, and Spiral etc. And he said that the Waterfall Model is some kind of an inadequate process because at the end of the process there are some misalignments since the customer interaction is so poor in Waterfall Model. In Waterfall Model customer see the product at the very end of the process. That is the main drawback of this model.

Then he came to the main topic, Agile Methodology and he defined it as a mindset. It means a way we should think. First he clarified 4 main Agile Manifesto principles such as individual and interaction over processes and tools, working software over comprehensive documentation, customer collaboration over contract negotiation, responding to change over following plan. Then he described famous Agile Manifesto 12 principles which are formed from above mentioned four principles. In the following space I listed all the Agile Manifesto rules and the details describes by the presenter shortly.

  • Our highest priority is to satisfy the customer through early and continuous delivery of valuable software:

We need to divide the deliverable into smaller pieces, which can be delivered earlier to customer. As it shorten the feedback loop, which help developers to understand what customer really want. Delay in delivery and not-valuable product will delay the feedback from the customer, which can delay the whole product 

  • Welcome changing requirements, even late in development. Agile processes harness change for the customer’s competitive advantage:


Changing requirements are very dynamic and live element, which grow and shape up to be a real product. To avoid those changes to happen late in requirement cycle, it is best to spend more time with the customer to understand it well in first place; it goes back to principle 1, of releasing early and in small iteration continuously. This is the major concept that Agile method differ from Waterfall model.

  • Deliver working software frequently, from a couple of weeks to a couple of months, with a preference to the shorter timescale:


This principle doesn’t just emphasize on delivery but actually on “working” software, the delivery which confirm definition of done, condition of satisfaction and value its own. And also the time periods for iterative delivery should be not so long because if it took long time then it again translates to Waterfall Model.

  • Business people and developers must work together daily throughout the project: 


This principle emphasize that there should be a commitment, direct collaboration and cooperation in all the phases of a project between the customer and development team. 

  • Build projects around motivated individuals. Give them the environment and support they need, and trust them to get the job done: 

In this principle we consider about hygiene factors of development team such as salary, vacation, working environment etc., which help to create motivate individuals
  • The most efficient and effective method of conveying information to and within a development team is the face-to-face conversation:

This principle emphasis on efficient and effective communication over status meetings, just like developers do during a daily meeting, it’s an act of conveying information. 

  • Working software is the primary measure of progress:

The most important measure for business should be working software. Happy customer is a result of working software, instead of focusing in unnecessary QA, sales and productivity metrics. Developers should measure the value of the product, listening to customer satisfaction.

  • Agile processes promote sustainable development. The sponsors, developers, and users should be able to maintain a constant pace indefinitely:

The main reason when team adapt to Agile is to have sustainability and scalability in their product, as it just cut through the waste. Making everyone to work with constant pace continuously, meaning with in with fixed set of scope to achieve it, collectively as a team of sponsors, developer and manager.

  • Continuous attention to technical excellence and good design enhances agility:


We need to pay close attention to technical excellence and design as our product evolves. There is a balance between “Building the right thing” and “Building the thing right”. Agile recommended test-driven development and automated- builds as a way to avoid fragile solutions.

  • Simplicity—the art of maximizing the amount of work not done—is essential:


It’s essential and simple to identify the amount of unimportant work and eliminate it to have a clear visibility for team, it’s reducing waste, removing impediments and limiting work in progress, but it’s an art which should be learn by doing it

  • The best architectures, requirements, and designs emerge from self-organizing teams: 


Self-organized team (all have common goal) deliver the best architecture, fully refined requirements and design, team here is a project team which includes development team, product owner, scrum master and stakeholder.

  • At regular intervals, the team reflects on how to become more effective, then tunes and adjusts its behavior accordingly: 


Apply the improvement process activities like the retrospective and other activities more often. Selforganize team tune to it and do the sanity check regularly. As project situation and realities keep changing, it’s not only process improvement but the team need to adjust its behavior to any change circumstance. Assuming that sprint scope keep on changing, it could be frustrating, but the team needs to understand that those changes which are directly coming from customers, it affect heavily on the value proposition and revenue stream. 

Then after the small break he presented about Scrum. Scrum is one of the most widely practiced Agile process. In Scrum development work and the teams are low coupled. Hence the development work does not depend on the team members. Even a team member moves out of the project, it does not effect to the flow of the development work. In Scrum there are lots of new words. I listed some words and their meanings below. 

  • Backlog – set of prioritized requirements that give business values.
  • Sprints - Work units which can be found in the back log requirements. Typically a sprint is a 20-30 day time box work unit. Sprint is frozen before work starts on it. Hence Scrum provides a short term and stable environment to work. 
  • Scrum meeting - This is a daily meeting which takes around 15 minutes. This will help to identify potential problems as early as possible.
  • Demos - A working software application is demonstrated to customer and gets the feedback. This demo will not contain 100% functionality. 
Then he described some details about Kanban and Scrumban. A Kanban system utilizes visual cues that calculate what to produce, when to produce and how much to produce. Scrumban is a mixed methodology of both Scrum and Kanban which increases adaptability and universality for product manufacturing and support focused companies. Then we did some activity for a given scenario (user can input two numbers and then can show numbers, clear numbers do some calculations such as factorial, multiplication etc.).We had to prioritize features of that scenario and then build user stories for that prioritized features. Through this activity we gained lot of knowledge about how can we choose main features and how to build user stories.

Findings 


Agile 


Agile software engineering combines a philosophy and a set of development guidelines. The philosophy encourages the customer satisfaction and early incremental delivery of software. Agile methods stress productivity and values over heavy-weight process overhead and artifacts. Agile methodology differ from other software processes because of some main features including small and highly motivated software teams, informal methods, minimal software engineering work products, and overall development simplicity. An agile process adapt incrementally.

To accomplish incremental adaptation, an agile team requires customer feedback. An effective tool to get customer feedback is an operational prototype or a portion of an operational system. Software increments must be delivered in short time periods so that the adaptations keep pace with the change. This iterative approach enables the customer to evaluate the software increment regularly and provide necessary feedback to the software team. The Agile Manifesto, a concise summary of Agile values, was written and signed in 2001 although Agile methods have existed since the early 90s. All the 12 principles are described in above section so I think no need to mention it again in this section. 

Scrum, Kanban and Scrumban 


Scrum is an iterative incremental process of software development commonly used with Agile software development. Although Scrum was intended to be for management of software development projects, itcan be used in running software maintenance teams, or as a program management approach.

Kanban is focused on continuous delivery of completed work or part of work. One of the most recognizable features of Kanban is WIP limits, which is used to reduce the amount of tasks that can be worked on at one time. As the work is continuous, the board stays persistent, only the tasks change. Workflow happens through a pull principle, where tasks are assigned after they went to the backlog or backlog priorities sections. New items can be added to the backlog whenever WIP limits allow it. Kanban doesn’t impose strict constraints, process is more flexible. Therefore it fits best for support, maintenance teams or continuous product manufacturing

Scrumban uses mixed techniques of both methodologies. It combines basic features of Scrum and flexibility of Kanban. Scrumban has a slightly constrained process where prioritization is optional, but it is recommended during each planning and planning is done by Kaizen events. Scrumban uses planning on demand principle to fill the backlog and tasks are assigned only by the pull system like in Kanban. Also, just like in Kanban, the board stays persistent, while only the tasks and their priorities change. In Scrumban the work is usually focused more on planning than releasing. This method is mostly used for fast-paced process like startups or projects which require continuous product manufacturing, where the environment is dynamic.


Following table summarize all the features of Scrum, Kanban and Scrumban