A brief introduction to javascript test driven development (TDD) towards several point of views by using qUnit, Karma & Jasmine, NodeJS tape module and custom frameworks.
AngularJS Unit Testing w/Karma and Jasminefoxp2code
This document provides instructions for setting up Angular unit testing with Karma and Jasmine. It discusses initializing Karma and Jasmine via NPM, configuring Karma, adding Angular and Angular mocks via Bower, writing describe and it blocks for tests, and using matchers and mocks like $httpBackend. The live coding section at the end indicates the document will demonstrate these concepts in real tests.
This document discusses Angular JS unit testing and provides examples of testing controllers, routes, services, and directives. It introduces Karma and Jasmine, two popular tools for Angular testing. Karma is a test runner that executes unit tests. Jasmine is a BDD framework used for writing unit tests with matchers to make assertions. Examples are given for setting up tests for controllers, routes, services, and directives by injecting dependencies and compiling elements.
Unit testing helps improving the quality of your code and greatly simplifies dealing with complex code. The testing framework of choice for React.js is Jest.
This document discusses testing AngularJS applications. It introduces popular testing frameworks like Jasmine and Karma that can be used to write unit tests and automate testing. Jasmine is typically used for testing AngularJS code and examples are given of writing tests with Jasmine. Karma is presented as a tool to automate testing by running tests in browsers. Protractor is introduced for end-to-end testing of front-end DOM elements. The document argues that front-end testing will become more important and integrated into development as tools continue to improve.
This document provides an overview of various tools for testing AngularJS applications, including testing frameworks like Jasmine and Mocha, unit testing with Karma and ngMock, end-to-end testing with Protractor, and automating tasks with Grunt. It describes the purpose and basic usage of these tools, provides code examples, and lists additional resources for learning more.
Unit testing of java script and angularjs application using Karma Jasmine Fra...Samyak Bhalerao
The document discusses unit testing of JavaScript and AngularJS applications using the Karma-Jasmine framework. It covers what testing and unit testing are, introduces the Karma test runner and Jasmine testing framework, and provides details on setting up Karma configuration files and writing tests using Jasmine specifications and matchers. The document also outlines how to test various aspects of AngularJS applications like controllers, services, directives and HTTP requests.
Test-Driven Development of AngularJS ApplicationsFITC
The document discusses test driven development for AngularJS applications. It outlines problems with traditional front-end development approaches like jQuery manipulation and lack of structure/modularity. The solution presented uses Node.js, NPM, Bower, Grunt, Jasmine and other tools to automate tasks, add structure and enable testing. Features of an example task tracking app are developed using a test-first approach with end-to-end and unit tests. The app is built incrementally by splitting development into small features and writing tests for each.
A simple setup on automated unit test using Karma + Jasmine with AngularJS
Link to GitHub for Source Code : https://github.com/kyaroru/IonicUnitTest
A presentation made for the AngularJS-IL meetup group that took place in May 2014 at Google TLV Campus. its a demonstration of Unit testing an AngularJS component with jasmine and karma.
Unit testing frameworks like Jasmine and Mocha can be used to write unit tests in Angular. Jasmine requires less setup and is fully BDD compliant. Tests are organized into describe blocks for test suites and it blocks for individual specs. Expectations are made using the expect function and matcher functions. Spies can mock and spy on functions. Karma is a test runner that runs tests across browsers and re-runs on file changes. It is configured via a karma.conf.js file. Unit tests validate controllers, services, and other application code. End-to-end tests using Protractor validate full user workflows and interactions.
Slides from a talk about unit tests in Node.js. The talk was held as a part of an internal Node.js course in ironSource's offices in Tel-Aviv. On Wednesday, September 14th, 2016
This document provides an overview of unit testing AngularJS applications using Karma, Jasmine, and Angular mocks. It discusses how to set up tests using Karma and Jasmine, write specs using matchers and spies, and mock dependencies using Angular mocks. Key points covered include isolating units of code for testing, using Karma to run tests in browsers, the structure of Jasmine specs, and mocking HTTP requests and other services.
Intro to testing Javascript with jasmineTimothy Oxley
Testing with Jasmine provides a framework for writing and running unit tests in JavaScript. It uses a behavior-driven development (BDD) style in which each test specifies the expected behavior it is testing using a describe and it blocks. Within the it block, expect statements make assertions about the code being tested using matchers like toEqual. Jasmine provides spies for mocking function calls and stubs. Running tests involves including Jasmine library files and specs in an HTML page and executing them with a simple HTTP server. Jasmine can also be used to test views by creating DOM fixtures and making assertions about the rendered markup.
This document discusses test-driven development with Jasmine and Karma. It justifies TDD for JavaScript, provides an overview of TDD and its benefits. It then explains the basics of Jasmine including suites, specifications, matchers and spies. Finally it covers configuring Karma and using tools like PhantomJS for running tests and karma-coverage for generating code coverage reports.
Unit testing Angular applications is important to ensure components and services work as expected. There are several frameworks that can be used for Angular unit testing, including Jasmine for writing tests and Karma as a test runner. Key aspects of unit testing covered in the document include: using test doubles like stubs and spies to isolate the system under test; focusing tests on small units and targeting specific assertions; and dealing with asynchronous code. The document also provides examples of writing pure unit tests in Jasmine without dependencies and using spies to control dependencies.
Unit testing and end-to-end (E2E) testing are important types of automated testing for JavaScript applications. Unit tests focus on testing individual functions or components in isolation to catch bugs, while E2E tests ensure that user flows work as expected by interacting with the application through a browser. The presentation discussed setting up testing frameworks like Karma and Jasmine for unit testing and Protractor for E2E testing. It also covered writing testable code, handling dependencies through dependency injection, and selecting elements and interacting with them during E2E tests.
This document discusses test-driven development for JavaScript using various testing frameworks like YUI Test, JSpec, and JsTestDriver. It covers how to set up unit testing for JavaScript, challenges like testing asynchronous code and events, and strategies for addressing those challenges using tools like Sinon.js for stubs and mocks. The document also provides examples of testing a chat client application and integrating JavaScript testing into a continuous integration workflow using Hudson.
This document discusses unit testing for mobile apps. It provides an overview of unit testing, including why to test code (to fix bugs early, refine design, ease changes, and provide documentation), how to test code (after writing, before writing, and after fixing bugs), and popular tools for unit testing iOS and Android apps, such as XCTest, JUnit, and Robolectric. Code samples are provided to demonstrate unit testing with XCTest, OCMock, JUnit, and Mockito. The presentation concludes with a demo of testing with KIF and a call for questions.
Unit, integration, and UI tests are important for ensuring code quality and stable React apps. Unit tests using Jest test components in isolation. Integration tests using Selenium test app functionality across full stack. UI tests using Galen test visual consistency across browsers, devices. Together, different types of tests provide confidence in clean code and consistent user experience.
This document discusses AngularJS unit testing. It covers why unit testing is important, setting up a basic testing environment with tools like Karma and Jasmine, writing different types of tests for controllers, components, directives, services and filters, mocking and stubbing, best practices, and resources for further reading on AngularJS testing.
This document provides an introduction to unit testing JavaScript code with Jasmine and Karma. It discusses the basics of Jasmine including test suites, specs, expectations, and matchers. It then covers how to set up and run tests with Karma, including configuring Karma, running tests in browsers, handling failures, and testing AngularJS code. Specific topics covered include spies, $httpBackend for mocking HTTP requests, and testing controllers and dependencies injection.
The document discusses unit testing and test-driven development. It introduces the QUnit JavaScript testing framework, describing how to write tests and assertions using its API. Key aspects covered include setting up QUnit, the test and assert functions, asynchronous testing, grouping tests into modules, and integrating automated testing with Node and Grunt.
This document provides an overview of automated testing in AngularJS, including unit testing, end-to-end testing, and acceptance testing using tools like Protractor and CucumberJS. It discusses the benefits of automated testing such as enabling safe refactoring and reducing bugs. It then demonstrates how to set up testing frameworks like Protractor and Karma and write tests using page objects and test-driven development. The document also covers acceptance testing with CucumberJS by writing step definitions and features in Gherkin and linking them to tests.
The document discusses unit testing with the Spock testing framework. It introduces Spock and outlines key concepts like the three pillars of good unit tests, Spock idioms, mocks and stubs, and continuous integration. Spock provides an expressive testing language based on Groovy that makes tests more readable, maintainable and trustworthy. Examples demonstrate how to write feature methods, use blocks, verify interactions, stub implementations, test exceptions, integrate with Spring, and perform HTTP calls and data-driven testing with Spock.
Test-Driven Development of AngularJS ApplicationsFITC
The document discusses test driven development for AngularJS applications. It outlines problems with traditional front-end development approaches like jQuery manipulation and lack of structure/modularity. The solution presented uses Node.js, NPM, Bower, Grunt, Jasmine and other tools to automate tasks, add structure and enable testing. Features of an example task tracking app are developed using a test-first approach with end-to-end and unit tests. The app is built incrementally by splitting development into small features and writing tests for each.
A simple setup on automated unit test using Karma + Jasmine with AngularJS
Link to GitHub for Source Code : https://github.com/kyaroru/IonicUnitTest
A presentation made for the AngularJS-IL meetup group that took place in May 2014 at Google TLV Campus. its a demonstration of Unit testing an AngularJS component with jasmine and karma.
Unit testing frameworks like Jasmine and Mocha can be used to write unit tests in Angular. Jasmine requires less setup and is fully BDD compliant. Tests are organized into describe blocks for test suites and it blocks for individual specs. Expectations are made using the expect function and matcher functions. Spies can mock and spy on functions. Karma is a test runner that runs tests across browsers and re-runs on file changes. It is configured via a karma.conf.js file. Unit tests validate controllers, services, and other application code. End-to-end tests using Protractor validate full user workflows and interactions.
Slides from a talk about unit tests in Node.js. The talk was held as a part of an internal Node.js course in ironSource's offices in Tel-Aviv. On Wednesday, September 14th, 2016
This document provides an overview of unit testing AngularJS applications using Karma, Jasmine, and Angular mocks. It discusses how to set up tests using Karma and Jasmine, write specs using matchers and spies, and mock dependencies using Angular mocks. Key points covered include isolating units of code for testing, using Karma to run tests in browsers, the structure of Jasmine specs, and mocking HTTP requests and other services.
Intro to testing Javascript with jasmineTimothy Oxley
Testing with Jasmine provides a framework for writing and running unit tests in JavaScript. It uses a behavior-driven development (BDD) style in which each test specifies the expected behavior it is testing using a describe and it blocks. Within the it block, expect statements make assertions about the code being tested using matchers like toEqual. Jasmine provides spies for mocking function calls and stubs. Running tests involves including Jasmine library files and specs in an HTML page and executing them with a simple HTTP server. Jasmine can also be used to test views by creating DOM fixtures and making assertions about the rendered markup.
This document discusses test-driven development with Jasmine and Karma. It justifies TDD for JavaScript, provides an overview of TDD and its benefits. It then explains the basics of Jasmine including suites, specifications, matchers and spies. Finally it covers configuring Karma and using tools like PhantomJS for running tests and karma-coverage for generating code coverage reports.
Unit testing Angular applications is important to ensure components and services work as expected. There are several frameworks that can be used for Angular unit testing, including Jasmine for writing tests and Karma as a test runner. Key aspects of unit testing covered in the document include: using test doubles like stubs and spies to isolate the system under test; focusing tests on small units and targeting specific assertions; and dealing with asynchronous code. The document also provides examples of writing pure unit tests in Jasmine without dependencies and using spies to control dependencies.
Unit testing and end-to-end (E2E) testing are important types of automated testing for JavaScript applications. Unit tests focus on testing individual functions or components in isolation to catch bugs, while E2E tests ensure that user flows work as expected by interacting with the application through a browser. The presentation discussed setting up testing frameworks like Karma and Jasmine for unit testing and Protractor for E2E testing. It also covered writing testable code, handling dependencies through dependency injection, and selecting elements and interacting with them during E2E tests.
This document discusses test-driven development for JavaScript using various testing frameworks like YUI Test, JSpec, and JsTestDriver. It covers how to set up unit testing for JavaScript, challenges like testing asynchronous code and events, and strategies for addressing those challenges using tools like Sinon.js for stubs and mocks. The document also provides examples of testing a chat client application and integrating JavaScript testing into a continuous integration workflow using Hudson.
This document discusses unit testing for mobile apps. It provides an overview of unit testing, including why to test code (to fix bugs early, refine design, ease changes, and provide documentation), how to test code (after writing, before writing, and after fixing bugs), and popular tools for unit testing iOS and Android apps, such as XCTest, JUnit, and Robolectric. Code samples are provided to demonstrate unit testing with XCTest, OCMock, JUnit, and Mockito. The presentation concludes with a demo of testing with KIF and a call for questions.
Unit, integration, and UI tests are important for ensuring code quality and stable React apps. Unit tests using Jest test components in isolation. Integration tests using Selenium test app functionality across full stack. UI tests using Galen test visual consistency across browsers, devices. Together, different types of tests provide confidence in clean code and consistent user experience.
This document discusses AngularJS unit testing. It covers why unit testing is important, setting up a basic testing environment with tools like Karma and Jasmine, writing different types of tests for controllers, components, directives, services and filters, mocking and stubbing, best practices, and resources for further reading on AngularJS testing.
This document provides an introduction to unit testing JavaScript code with Jasmine and Karma. It discusses the basics of Jasmine including test suites, specs, expectations, and matchers. It then covers how to set up and run tests with Karma, including configuring Karma, running tests in browsers, handling failures, and testing AngularJS code. Specific topics covered include spies, $httpBackend for mocking HTTP requests, and testing controllers and dependencies injection.
The document discusses unit testing and test-driven development. It introduces the QUnit JavaScript testing framework, describing how to write tests and assertions using its API. Key aspects covered include setting up QUnit, the test and assert functions, asynchronous testing, grouping tests into modules, and integrating automated testing with Node and Grunt.
This document provides an overview of automated testing in AngularJS, including unit testing, end-to-end testing, and acceptance testing using tools like Protractor and CucumberJS. It discusses the benefits of automated testing such as enabling safe refactoring and reducing bugs. It then demonstrates how to set up testing frameworks like Protractor and Karma and write tests using page objects and test-driven development. The document also covers acceptance testing with CucumberJS by writing step definitions and features in Gherkin and linking them to tests.
The document discusses unit testing with the Spock testing framework. It introduces Spock and outlines key concepts like the three pillars of good unit tests, Spock idioms, mocks and stubs, and continuous integration. Spock provides an expressive testing language based on Groovy that makes tests more readable, maintainable and trustworthy. Examples demonstrate how to write feature methods, use blocks, verify interactions, stub implementations, test exceptions, integrate with Spring, and perform HTTP calls and data-driven testing with Spock.
This document discusses building automated acceptance tests that are stable and maintainable for continuous delivery. It emphasizes that developers should own acceptance testing by writing tests in the same way they write production code. This includes writing many unit and regression tests, optimizing for test execution, using immutable environments like Docker for isolation, and leveraging techniques like parallelization and separation of concerns with domain-specific languages. The document also provides examples of testing strategies, tools, and processes that can help achieve this goal.
This document discusses different strategies and methods for testing JavaScript code, including unit testing, behavior testing, test-driven development, and behavior-driven development. It provides examples of implementing tests using frameworks like QUnit, Jasmine, and YUI Test. Asynchronous testing, test organization, matchers, spies and mocks are also covered.
Integration testing is hard, and often teams are tempted to do it in production. Testcontainers allows writing meaningful integration tests spawning Docker containers for databases, queue systems, kv-store, other services. The talk, a blend of slides and live code, will show how we are able to deploy without fear while integrating with a dozen of different datastores. Don't mock your database with fake data anymore, work with real data
The document provides an overview of unit testing concepts and best practices. It discusses what unit testing is, why it's useful, and common terminology like test-driven development, stubs, spies, mocks and fixtures. It also covers unit testing tools and libraries, specifics of unit testing JavaScript code, and best practices like writing tests that are fast, isolated, consistent and self-descriptive.
The document discusses testing legacy Rails applications. It provides steps to get testing set up on a legacy Rails app, including creating a test database, running migrations, and getting Rake tasks to run tests. It emphasizes starting with one test at a time, finding and fixing bugs, and refactoring code. Examples are given of writing a model test based on application logs and fixing a failure by updating code. The document stresses treating methods as isolated boxes and only testing one thing at a time to incrementally add tests to a legacy codebase.
Protractor framework architecture with exampleshadabgilani
Protractor is an open source functional testing framework for AngularJS applications. It automates interaction with AngularJS apps for end-to-end testing. Protractor uses Selenium WebDriver for browser control and Jasmine or Mocha for writing test cases. Tests are organized into pages, common utilities, test data, specs, and configuration files. Protractor provides locators and functions to test AngularJS apps and generates Allure reports for test results.
The document provides an introduction to JUnit testing in Java. It discusses how to set up a JUnit test with the AEM testing framework using the AemContextExtension. Key aspects covered include adding Sling models to the test context, loading mock JSON resources, and adapting requests to test Sling models. The anatomy of a JUnit test is explained with examples of setting up mocks, verifying expectations, and asserting results. Mocking and the Mockito framework are also introduced for simulating dependencies in tests.
Quick tour to front end unit testing using jasmineGil Fink
This document discusses front-end unit testing using the Jasmine testing framework. It explains why unit testing is important, introduces behavior-driven development and the Jasmine framework. It also provides an overview of setting up Jasmine, creating test suites and specs, using matchers, and testing asynchronous code. The document demonstrates how to set up the testing environment, write tests with Jasmine, and integrate Jasmine with the Karma test runner.
This presentation deals with a complex approach to application testing in back end and front end parts, tests writing and common mistakes. It also includes a short overview of libraries and frameworks for creation of tests, as well as practical examples of code.
Presentation by Pavlo Iuriichuk, Lead Software Engineer, GlobalLogic, Kyiv), delivered at an open techtalk on December 11, 2014.
More details - http://globallogic.com.ua/report-web-testing-techtalk-2014
The document discusses strategies for testing a web application, including:
- Using static analysis tools like FindBugs to analyze source code.
- Using QUnit to test JavaScript functions and refactoring code to make it testable.
- Using Selenium to automate UI testing and catch bugs by verifying page content.
- Implementing continuous integration using an existing Cruise Control server to automatically run tests.
This document summarizes how to test Java web applications on mobile devices using Arquillian and Selenium. It describes setting up Android emulators, configuring the Arquillian extension for AndroidDriver, and writing sample unit and functional tests for a mobile web application using Page Object Model patterns and the WebDriver API. Tips are provided for debugging tests, capturing screenshots on failure, and integrating tests with Jenkins.
Security testing of YUI powered applicationsdimisec
http://lanyrd.com/2012/yuiconf/szwrf/
Everyone agrees that application security is of crucial importance, and attacks on web frontends are getting more frequent, sophisticated, and dangerous. Yet the area of security testing of frontend and YUI-based applications has so far received little attention. This talk highlights the need to embed security testing in the standard repertoire of every Javascript and YUI developer, alongside with functionality and performance tests. We will emphasize the security testing as part of development workflow - writing and running tests alongside creating the code. Our main goal is to attract the YUI community's attention to this grey area and start a discussion and cooperation of webappsec and YUI worlds.
An introduction to the complex single page web application framework known as AngularJs. An attempt to overview the high-level aspects of the framework, and to supply references for further exploration.
Android UI Testing with Appium
This presentation covers:
- how appium works
- setting up test development environment with AndroidStudio
- running tests
- UI automation best practices
- common problems with automation
This document provides an overview of using the JEST testing framework for Lightning Web Components (LWC) in Salesforce. It discusses why testing is important, how to set up JEST for LWC testing, where to write tests, test code structure, running and viewing test results. The presenter demonstrates writing a basic test for a LWC, running tests, and formats for viewing test results. Attendees are invited to the next meetup about implementing custom cells in the Lightning Datatable component.
We Are All Testers Now: The Testing Pyramid and Front-End DevelopmentAll Things Open
The document provides an overview of test-driven development (TDD) principles and how to implement testing for front-end development. It discusses the benefits of TDD, such as avoiding bad designs and preventing regressions. It also addresses common challenges with TDD, like slowing initial velocity and ignored tests over time. The document then covers different levels of testing, including unit tests, integration tests, and functional/end-to-end tests using the testing pyramid as a framework. It provides examples of writing tests for pure and impure functions using the Jest testing framework. Finally, it discusses functional testing using Cucumber.js behavior-driven development.
Javascript unit testing, yes we can e bigAndy Peterson
This document discusses test-driven development for JavaScript using ScrewUnit and BlueRidge. It introduces the Carbon Five consulting firm and covers why JavaScript unit testing is important. It then demonstrates how to write behavioral tests using ScrewUnit's BDD style and shows a live example testing a wizard component. Some challenges of JavaScript testing like DOM cleanup and structure are addressed. The document emphasizes that JavaScript testing is possible and can be integrated into the development process.
ELectronics Boards & Product Testing_Shiju.pdfShiju Jacob
This presentation provides a high level insight about DFT analysis and test coverage calculation, finalizing test strategy, and types of tests at different levels of the product.
☁️ GDG Cloud Munich: Build With AI Workshop - Introduction to Vertex AI! ☁️
Join us for an exciting #BuildWithAi workshop on the 28th of April, 2025 at the Google Office in Munich!
Dive into the world of AI with our "Introduction to Vertex AI" session, presented by Google Cloud expert Randy Gupta.
The role of the lexical analyzer
Specification of tokens
Finite state machines
From a regular expressions to an NFA
Convert NFA to DFA
Transforming grammars and regular expressions
Transforming automata to grammars
Language for specifying lexical analyzers
We introduce the Gaussian process (GP) modeling module developed within the UQLab software framework. The novel design of the GP-module aims at providing seamless integration of GP modeling into any uncertainty quantification workflow, as well as a standalone surrogate modeling tool. We first briefly present the key mathematical tools on the basis of GP modeling (a.k.a. Kriging), as well as the associated theoretical and computational framework. We then provide an extensive overview of the available features of the software and demonstrate its flexibility and user-friendliness. Finally, we showcase the usage and the performance of the software on several applications borrowed from different fields of engineering. These include a basic surrogate of a well-known analytical benchmark function; a hierarchical Kriging example applied to wind turbine aero-servo-elastic simulations and a more complex geotechnical example that requires a non-stationary, user-defined correlation function. The GP-module, like the rest of the scientific code that is shipped with UQLab, is open source (BSD license).
"Boiler Feed Pump (BFP): Working, Applications, Advantages, and Limitations E...Infopitaara
A Boiler Feed Pump (BFP) is a critical component in thermal power plants. It supplies high-pressure water (feedwater) to the boiler, ensuring continuous steam generation.
⚙️ How a Boiler Feed Pump Works
Water Collection:
Feedwater is collected from the deaerator or feedwater tank.
Pressurization:
The pump increases water pressure using multiple impellers/stages in centrifugal types.
Discharge to Boiler:
Pressurized water is then supplied to the boiler drum or economizer section, depending on design.
🌀 Types of Boiler Feed Pumps
Centrifugal Pumps (most common):
Multistage for higher pressure.
Used in large thermal power stations.
Positive Displacement Pumps (less common):
For smaller or specific applications.
Precise flow control but less efficient for large volumes.
🛠️ Key Operations and Controls
Recirculation Line: Protects the pump from overheating at low flow.
Throttle Valve: Regulates flow based on boiler demand.
Control System: Often automated via DCS/PLC for variable load conditions.
Sealing & Cooling Systems: Prevent leakage and maintain pump health.
⚠️ Common BFP Issues
Cavitation due to low NPSH (Net Positive Suction Head).
Seal or bearing failure.
Overheating from improper flow or recirculation.
Passenger car unit (PCU) of a vehicle type depends on vehicular characteristics, stream characteristics, roadway characteristics, environmental factors, climate conditions and control conditions. Keeping in view various factors affecting PCU, a model was developed taking a volume to capacity ratio and percentage share of particular vehicle type as independent parameters. A microscopic traffic simulation model VISSIM has been used in present study for generating traffic flow data which some time very difficult to obtain from field survey. A comparison study was carried out with the purpose of verifying when the adaptive neuro-fuzzy inference system (ANFIS), artificial neural network (ANN) and multiple linear regression (MLR) models are appropriate for prediction of PCUs of different vehicle types. From the results observed that ANFIS model estimates were closer to the corresponding simulated PCU values compared to MLR and ANN models. It is concluded that the ANFIS model showed greater potential in predicting PCUs from v/c ratio and proportional share for all type of vehicles whereas MLR and ANN models did not perform well.
Value Stream Mapping Worskshops for Intelligent Continuous SecurityMarc Hornbeek
This presentation provides detailed guidance and tools for conducting Current State and Future State Value Stream Mapping workshops for Intelligent Continuous Security.
Sorting Order and Stability in Sorting.
Concept of Internal and External Sorting.
Bubble Sort,
Insertion Sort,
Selection Sort,
Quick Sort and
Merge Sort,
Radix Sort, and
Shell Sort,
External Sorting, Time complexity analysis of Sorting Algorithms.
Lidar for Autonomous Driving, LiDAR Mapping for Driverless Cars.pptxRishavKumar530754
LiDAR-Based System for Autonomous Cars
Autonomous Driving with LiDAR Tech
LiDAR Integration in Self-Driving Cars
Self-Driving Vehicles Using LiDAR
LiDAR Mapping for Driverless Cars
"Feed Water Heaters in Thermal Power Plants: Types, Working, and Efficiency G...Infopitaara
A feed water heater is a device used in power plants to preheat water before it enters the boiler. It plays a critical role in improving the overall efficiency of the power generation process, especially in thermal power plants.
🔧 Function of a Feed Water Heater:
It uses steam extracted from the turbine to preheat the feed water.
This reduces the fuel required to convert water into steam in the boiler.
It supports Regenerative Rankine Cycle, increasing plant efficiency.
🔍 Types of Feed Water Heaters:
Open Feed Water Heater (Direct Contact)
Steam and water come into direct contact.
Mixing occurs, and heat is transferred directly.
Common in low-pressure stages.
Closed Feed Water Heater (Surface Type)
Steam and water are separated by tubes.
Heat is transferred through tube walls.
Common in high-pressure systems.
⚙️ Advantages:
Improves thermal efficiency.
Reduces fuel consumption.
Lowers thermal stress on boiler components.
Minimizes corrosion by removing dissolved gases.
12. Test with nodeJS
- Asserts
- Testing Anything Protocol (TAP) & tape module
13. (Fake) TDD
Keep fixing code until you cannot see any bugs by using:
- Console.log
- Dump
- Alert
- Debugger
14. (REAL) TDD
Write test while developing, test by using dump(), breakpoint,
autotest once the code has been updated, keep track of bug
fixing, test against as many browsers as you can, wait for your
tests to tell you all has gone.
17. Jasmine Behaviour-Driven Development
beforeEach & afterEach – set up pre & post conditions and will run
before(after) every test in its block.
Describe – wraps a block of related tests. Descriptive name.
It – meant to be read as a sentence
Expect - allows to make assertions (1 assertion per it block)
spies (toHaveBeenCalled)
toBe & toContain
19. setting up
bower install angular angular-mocks
angular mocks: contains useful mocking tools to easily test angularJS
modules. Just include the angular-mocks.js file into your karma-conf.js
20. Test controllers
Hold an istance of the ctrl, init a scope & test expectations
// get the module that contain the controller
beforeEach(module('todolist'));
// inject the $controller and the rootScope
beforeEach(inject(function ($rootScope, $controller) {
// create a fresh new scope for the controller
scope = $rootScope.$new();
// create a controller with this scope
ctrl = $controller('TodoListController',{$scope: scope});
}));
21. Test services
use $injector to get an instance of the service
// get the module that contain the service
beforeEach(module('todolist'));
// inject the $injector
beforeEach(inject(function ($injector) {
// use the $injector to get a hold on the service
service = $injector.get(‘ServiceName’);
}));
22. test directive
Create an element which will host the directive and compile it
with a scope. Trigg the digest too.
// get the module that contain the service
beforeEach(module('todolist'));
// inject the $compile service and the $rootScope
beforeEach(inject(function ($compile, $rootScope) {
// use the $rootScope to create a scope for the directive
scope = $rootScope;
// create an angular element from a HTML string
element = angular.element(‘<div my-directive ></div>’);
// compile the element with the scope
$compile(element)(scope);
scope.$apply()
}));
23. Test http requests
$httpBackend as fake backend implementation
Given some particular state of my app
set up state, mock or spy functions if necessary
When I call some method
call the method you’re testing
Then that method behaves in a certain way
verify the method did the right thing
24. Test http requests
// inject the $httpBackend service and the $rootScope
beforeEach(inject(function ($httpBackend) {
// use the $rootScope to create a scope for the directive
httpBackend = $httpBackend;
it("something that make a request", function() {
// expect a request
httpBackend.expectGET(‘api’).respond(200);
// code that make a request
httpBackend.flush(); // do`nt forget to flush..
});
}));
28. Mocha (https://mochajs.org ) - is a test framework. Mocha sets
up and describes test suites
Chai (http://chaijs.com ) - is an expectation framework. It
provides convenient helpers to perform all kinds of assertions
against your JavaScript code.
Sinon (http://sinonjs.org ) - is a great JavaScript library for
stubbing and mocking such external dependencies and to keep
control on side effects against them. It helps us to create a
sandbox environment.