Module 1 - Junit Fundamentals.
Lesson 1: Introduction to Unit Testing and JUnit
🎯 Goal:Understand what JUnit is, its purpose,
setup, and first test case.
What is Unit Testing ?
• Definition:
Unit testing is the practice of testing individual pieces of code like methods or classes in
isolation to check if they work as intended.
• Importance:
It ensures that each function behaves correctly before integrating it with others, reducing
chances of future bugs.
• Tools/Code:
JUnit, TestNG, NUnit (for .NET), PyTest (for Python)
• Analogy:
Like checking whether each bolt and screw works properly before assembling a machine.
Why Unit Testing?
• Definition:
Unit testing ensures the smallest part of an application works as expected before integration.
• Importance:
Catches bugs early in the SDLC, reduces cost of fixing, and enables safe refactoring.
IBM study: fixing a bug in production costs 100x more.
• Tools/Code:
Used with CI/CD tools like Jenkins, GitHub Actions for automated testing (no manual checks).
• Analogy:
Like testing each car part before assembly, not waiting for the whole car to crash.
What is JUnit?
Definition:
JUnit is a popular open-source testing framework for Java that helps developers write and automate unit tests.
Importance:
Reduces manual effort, helps automate testing in build pipelines, and provides readable test reports.
Tools/Code:
Built-in support in Eclipse, IntelliJ, used with Maven/Gradle for builds.
Analogy:
Think of JUnit as a referee checking if your method is playing fair and not cheating.
JUnit
Definition:
4 vs JUnit 5
JUnit 5 is the latest major version of the JUnit framework with more modular and flexible features.
Importance:
JUnit 5 supports better test organization, modern Java features (lambdas), and is more extendable.
Tools/Code:
•JUnit 4: @Before, @Test, @After
•JUnit 5: @BeforeEach, @Test, @AfterEach, Jupiter Engine
•Packages: org.junit (JUnit 4) vs org.junit.jupiter (JUnit 5)
Analogy:
Like moving from a basic feature phone (JUnit 4) to a smart Android phone (JUnit 5) — more power, more
flexibility.
Setting Up Junit
● Definition:
To use JUnit, you need to include its library in your Java project — via Maven, Gradle, or IDE setup.
● Importance:
Without setup, you can’t write or run tests. Once added, you get access to all testing features.
● Tools/Code: Maven:
<!-- https://mvnrepository.com/artifact/org.junit.jupiter/junit-jupiter -->
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter</artifactId>
<version>5.11.4</version>
<scope>test</scope>
</dependency>
● Gradle:
// https://mvnrepository.com/artifact/org.junit.jupiter/junit-jupiter
testImplementation("org.junit.jupiter:junit-jupiter:5.11.4")
● Analogy:
Like adding a toolkit to your workspace before starting to build or repair something.
Your First Java Unit Test
Definition:
A test case in JUnit is a method annotated with @Test that checks whether a piece of logic returns the expected result.
Importance:
It's the most basic yet essential building block of any testing strategy.
Tools/Code:
import static org.testng.Assert.assertEquals;
import org.testng.annotations.Test;
public class Calculator {
public int add(int a, int b) {
return a + b;
}
@Test
void testAddition() {
Calculator calc = new Calculator();
assertEquals(4, calc.add(2, 2));
}
}
Analogy:
Like double-checking your calculator’s answer before trusting it with all math problems.
A Model To Evaluate Balanced
Scorecard
Financial Perspective Customer Perspective
Goals Measures Goals Measures
Survive ● Cash Flow New Products ● Percent of sales
Succeed ● Quarterly sales from new
growth and products
operating income ● Percent of sales
Prosper by division Responsive Supply from proprietary
● Increased market products
share and ROE Preferred Supplier ● On-time delivery
(defined by
customer)
● Share of key
Customer Partnership accounts'
purchases
● Ranking by key
accounts
● Number of
cooperative
A Model To Evaluate Balanced
Scorecard
Financial Perspective Customer Perspective
Goals Measures Goals Measures
Technology ● Manufacturing Technology ● Time to
Capability geometry vs. Leadership develop next
competition Manufacturing generation
● Cycle time Learning ● Process time to
Manufacturing ● Unit cost Product Focus maturity
Excellence ● Yield Time to Market ● Percent of
● Silicon products that
efficiency equal 80%
Design Productivity ● Engineering sales
New Product efficiency ● New product
Introduction ● Actual introduction vs.
introduction competition
schedule vs.
plan
Module 2 - Core Components of
Junit.
🎯 Goal: Understand structure, annotations, and
assertion mechanisms in JUnit 5.
Advantages Of Balanced
Scorecard
Traditional financial measures are incomplete.
Balanced scorecard includes financial and non-financial
measures.
Considers both short-term and long-term objectives.
Provides a holistic view of performance.
Enables better alignment of strategies with goals.
The GE-Mckinsey Nine-Box Matrix
● Purpose: Guides decentralized
corporations in cash allocation.
● Factors: Considers industry
attractiveness and unit
competitiveness.
● Analytic Map: Positions units
for investment, selective
investment, or divestment.
The GE-Mckinsey Nine-Box Matrix
● Categories: Above diagonal
for growth, on diagonal for
selectivity, below diagonal for
divestment.
● Judgment: Required to
balance trade-offs.
● Evolution: Predecessor to
modern portfolio models.
● Relevance: Still widely used in
Determine The Industry
Attractiveness
Calculate the market attractiveness in which each SBU operates.
Remember, this is a subjective estimate based on your understanding of the
SBUs industry or sector.
Score the SBUs industry by looking at factors like:
● Market size ● Market profitability
● Industry profitability ● Differentiation
● Market growth potential ● Market growth rate
● Industry segmentation ● Level of competition
Determine The Industry
Attractiveness
You’ll then repeat this process for each company in your portfolio. Look at
the strength of the business unit and its competitive position in the market.
Factors you can consider when working out the strength of a business unit:
● Sustainable competitive ● Strength of the value chain
advantages ● Production capacity
● Brand equity ● Product lines
● Customer loyalty ● Pricing and cash flows
● Market share ● Profit margin compared to
● Internal competencies competitors
Growth Share Matrix
● Growth Share Matrix is a portfolio
management framework that helps
companies to decide how to prioritize
their different businesses by their
degree of profitability.
● The four quadrants represents a specific
combination of relative market share,
and growth:
Growth Share Matrix
● Low Growth, High Share :-
Companies should milk these “cash
cows” for cash to reinvest.
● High Growth, High Share :-
Companies should significantly invest in
these “stars” as they have high future
potential.
● High Growth, Low Share :-
Companies should invest in or discard
these “question marks,” depending on
their chances of becoming stars.
● Low Share, Low Growth :-
Growth Share Matrix
BCG Growth Matrix for BCG Growth Matrix for
Apple Samsung
How Does the Growth Share
Matrix Work?
Market leadership leads to sustainable returns.
Leaders gain cost advantages hard to replicate.
High growth indicates market potential.
Investment decisions consider competitiveness and market
attractiveness.
Relative market share and growth rate are key factors.
PESTLE Analysis
P E S T L E
Political Economical Social Technologic Legal Environmen
al tal
Example: Example: Example: Example: Example: Example:
● Current tax ● Inflation ● Lifestyle ● Level of ● Employme ● Weather
policy Rate attitudes innovation nt laws ● Climate
● Brexit ● Exchange ● Cultural ● Automation ● Discriminat Change
● Trade rates barriers ● Technologic ion laws ● Environme
policies ● Economic ● Population al ● Health and ntal Policies
● Political growth growth awareness safety ● NGO
stability ● Interest ● Population ● Cybersecur ● Copyright Pressure
● Governmen rates Age ity Protection ● Recycling
t policy ● Disposable ● Health ● Technologic ● Consumer ● Pollution
income Consciousn al Change Safety ● Sustainabili
● Unemploy ess ● Internet ty
ment Rate ● Target availability
Demograph
ics
Applying PESTLE In Business
Gather Information
Identify Trends
Assess Impacts
Develop Strategies
Monitor
Continuously
PESTLE Analysis For AirBnb
Political Landscape
● Housing laws and vacation Environment Landscape
rental bans in some markets • Environmental impact of single-
conflict with business model. use products for hospitality
● Varying tax rates from
counties and countries.
P E
Economic Landscape Social Landscape
• The housing crisis and crunch in • Increase access and desirability
the housing market.
• Varying prices and availability E S of travel.
• Resistance from locals about
the impact of vacation rentals in
of hotels as a primary
competitor. residential areas.
L T
Technology Landscape
Legal Landscape • Increased reliance on mobile
• Legal challenges in some states apps and other digital solutions.
• Increasing security of online
and countries
payment systems
Value Chain Analysis
Value chain refers to the various business activities and processes
involved in creating a product or performing a service.
➔ Evaluation
➔ Improvement
➔ Efficiency
➔ Cost
➔ Differentiation
➔ Competitive
➔ Integration
Components Of A Value Chain
Secondary Activities
Infrastructure
Company overhead and management, including financing and
planning
Human Resources Management
Recruitment, hiring, training, development, retention, and
compensation of employees
Technological Development
Research and development, including product design, market
research, and process development
Procurement
The sourcing of raw materials, components, equipment, and
services
Components Of A Value Chain
Primary Activities
Inbound Operations Outbound Marketing After Sales
Logistics Logistics and Sales Services
Receiving, Processes Distribution, Promotion, Installation,
Warehousing involved includire advertising training,
and Inventory in turning raw packaging, and pricing quality
Management materials and sorting strategy assurance,
components and shipping repair and
into finished customer
products semice
Components Of A Value Chain
Primary Secondary
Activities Activities
● Operations ● Procurement
● Outbound logistics ● Technological development
● Marketing and sales ● Human resources management
● After-sales services ● Infrastructure
● Inbound Logistics
How to conduct a Value Chain
Analysis?
1 2 3
IDENTIFY VALUE DETERMINE IDENTIFY
CHAIN ACTIVITIES ACTIVITIES VALUE COMPETITIVE
AND COSTS ADVANTAGE
OPPORTUNITIES
List all the primary and
secondary activity that Determine the value Analyze your value
go into your services that each business chain through the lens
creation. activity adds to the of your competitive
process, along with advantage goals.
associated costs.
Amazon : Value Chain Analysis
Firm Human Technology Procurement
Infrastructure Resources
● Company's ● Hiring and ● Research and ● Process of
support system retaining development acquisition of
and the functions employees who helps designing inputs, raw
that allow it to will fulfill business the product and materials or
maintain strategy, as well improving and resources, for the
operations as help design, automating the firm
market, and sell process
● Includes all legal, ● This relates
the product
administrative ● For example, a heavily to inbound
and accounting ● Involve in the business working logistics where
process of towards to reduce company is
delivering the the inventory and looking for resale
finished product labor waste by the goods they
implementing procure. For
● A source of
RFID technology example in case
competitive
in warehouse to of an e-commerce
advantage when
improve overall business
customer
stock accuracy
purchasing a
and minimize
service
labor tasks
Amazon : Value Chain Analysis
Inbound Operations Outbound Marketing and After Sales
Logistics Logistics Sales Services
Amazon sources Orders are Amazon ships Its website, mobile Amazon places a
products from processed and products to app, and social strong emphasis
suppliers around prepared for customers around media 96 on providing high-
the world and shipment through the world using a platforms give quality
transports them to Amazon's network of carriers Amazon a variety customer service,
its fulfillment fulfilment centers. and logistics of ways to reach including fast and
centers. Advanced The company partners. It customers. The easy returns, 24/7
logistics and utilizes advanced provides fast and company also customer support,
inventory automation convenient service offers personalized and a range of self-
management technologies and through a range of product service option
systems optimize robotics to delivery options. recommendations Amazon Prime is a
its inbound streamline Its and targeted loyalty program
logistics and operations and advertising to that provides
ensure that improve efficiency enhance the customers with
products are and reduce labor customer free shipping,
available for sale costs. experience. exclusive
in a timely manner. discounts, and
other benefits in
addition to
SWOT Analysis
❖ A Great SWOT Analysis Helps
Answer These 3 Critical
Questions.
● How to succeed, and why?
● What growth opportunities exist,
and why?
● How to serve your customers
better, and why?
6 Tips for Building an Effective
SWOT
➔ Use data wherever possible instead of relying only on
opinions.
➔ Write more than 1-2 words for each.
➔ SWOT entries should lead to action.
➔ Identifying internal opportunities in the “Opportunities”
section makes the assessment fall apart.
➔ Engage multiple levels of the organization in brainstorming to
source great ideas.
SWOT Analysis Examples
Apple Swot Analysis
Strengths Opportunities
● Brand recognition ● Expand Distribution Options
● Innovative Products ● Create New Product Lines
● Ease of use ● Technological
Weaknesses Threats
● High Prices ● Tough Competition
● Closed Ecosystem ● Law Suits
● Lack of Experimentation ● International Issues
SWOT Analysis Examples
Starbucks Swot analysis
Strengths Opportunities
● Great Brand Recognition ● Diversify Products for Culture
● Recognizable Chain ● Expand in Asia and Africa
● High Quality Unique Products ● Use Technical Advances as a
way to Distribute Products
Weaknesses Threats
● High Prices ● Low Cost Coffee Sellers
● Easy to imitate Products ● Independent Coffee House
● Products don't Account for ● Other Business imitate
Cultural Diversity in some Products
Regions
THANK YOU