Tuesday, 16 April 2024

Generative AI Notes

Generative AI creates new high-quality content (text / images / sound / video) based on a query. Generative AI models are trained on vast amounts of raw data: texts, images, sounds, videos.

How LLMs generate text

  • The model receives a text as input.
  • The model tries to generate the most suitable next word.
  • After that, the generated word is added to the initial text and fed back to the model. Again, the model tries to generate the most suitable next word. And so on. 

Algorithm for prompt engineering for solving applied problems using LLMs 

  • Step 1: Formulate the initial prompt.
  • Step 2: Run the prompt with a sample set of examples. 
  • Step 3: Analyse errors.
  • Step 4: Improve the prompt based on error analysis and repeat from step 2.

It is worth repeating the cycle and refining the prompt until the responses reach the necessary quality.

Basic recommendations for prompt engineering

Use clear and detailed instructions.

  • Specify the role that the model plays when it needs to generate a response. For example, you can instruct it to act as a product manager or analyst who conducts research and analyses user feedback.
  • Use separators between semantic blocks, such as "", ===, < >, <tag> </tag>. There are no formal recommendations on which type of separator to use for different use cases; the main consideration is that different semantic blocks should be explicitly separated.
  • Specify the format of the response: JSON, HTML, table, or other.
  • Provide examples of correct and incorrect answers for the given task.
  • Ask the model to verify if all necessary conditions are met.

Give models 'time to think'

  • List instructions for performing the task as a clear sequence of steps. Example: Step 1: do X, Step 2: do Y, ..., Step N: do Q. 
  • Add the instruction 'Solve the problem step by step' to the prompt.
  • Ask the model to provide explanations for its answers. This will help with ideas for improvements in the next iteration.

Always evaluate the quality of prompts

  • We will use the train dataset to design prompts, analyze errors, and optimize the prompt’s quality.
  • We will use the test dataset for the final evaluation of the prompt's quality. 
  • A critical area of responsibility for an AI product manager is to decide what must be done based on business metric measurements, and where to make intuitive decisions based on quality metric measurements.

General approach to solving problems with LLMs

Understand the problem and design a pipeline.

For each element of the pipeline:

  • Determine the quality metrics.
  • Find or create the necessary data.
  • Create prompts based on iterative improvement and error analysis to achieve good solution quality.
  • Convert the output of the pipeline work into a useful format.
  • Make sure that the AI system creates user and business value. 

AI systems

Creating an AI pipeline to solve your problem is just the first step towards developing a production solution. A full-fledged AI system contains many components to work predictably and reliably.

Aspects that are important to consider when implementing AI systems:

  • Monitoring the quality of data and model responses.
  • Monitoring cloud service changes.

Business value and costs of GenAI solutions

The AI product manager must address questions regarding the business value and costs of GenAI solutions. This includes:

  • Evaluating the cost of using models.
  • Choosing the optimal model for the project.
  • Determining how to evaluate value for business.

In the case study, we showed how to quickly implement an AI pipeline for analyzing reviews, which was comparable to leading solutions in the industry. In the past, creating such a product required an expensive team of AI engineers. Modern technologies allow a small team or even one person without special knowledge to create the core of such a service in a few hours.

Even if you forget everything, remember this

Previously, solving AI problems required AI specialists with deep knowledge of machine learning, mathematics, and programming.

Modern generative AI tools allow solving many problems without such a team. However, it is still necessary to master the fundamentals of creating AI products, as well as consider the specifics of business problems.

Monday, 15 April 2024

AI in Testing Playlist Videos

1. Introduction: https://lnkd.in/ddh_R84K

2. What is AI in Testing? https://lnkd.in/d9Mfyexj

3. Usage of AI in Testing: https://lnkd.in/dSddFb8D

4. AI Wisdom, Tools & Building Your Own Model: https://lnkd.in/d8qX9DYi

5. Case Study Analysis - ChatGPT sucks at testing: https://lnkd.in/dah2RK4y

6. FREE AI Tool for Testers: https://lnkd.in/dvX4E_xD

7. Prompt Engineering Tips & Techniques: https://lnkd.in/dRZ49AHW

8. Prompts for Testing Activities: https://lnkd.in/da97_paj

9. Generate Test Data using AI: https://lnkd.in/dZhN286A

10. Risks of using AI in Testing & for Testers: https://lnkd.in/dYxpv4p9

11. Becoming an AI in Testing Champion: https://lnkd.in/dFAmkA8C

12. Generating Code with AI & First Coding Project using AI: https://lnkd.in/dmwkQtP4

13. Planning for AI in Testing: https://lnkd.in/d6MC7-kH

14. Accessibility Testing using AI: https://lnkd.in/dECnsPb3

15. Automate Bug Reporting via AI: https://lnkd.in/dfH5FdWM

16. Concerns about using AI in Testing: https://lnkd.in/dKSd5N_E

17. AI for Test Prioritization - Risks & Benefits: https://lnkd.in/d9Q53sEw

18. AI Self-Healing for Locators: https://lnkd.in/d_GGsX-X

19. AI in Testing Manifesto: https://lnkd.in/dfbdNQ9t

20. Skills required for AI-assisted Testing: https://lnkd.in/d4QrCPW3 

21. Visual UI Testing using AI: https://lnkd.in/duaT2kPv

22. Code Analysis & Explanation using AI: https://lnkd.in/dkbekGBF

23. AI for Security Testing: https://lnkd.in/dg7ymxCB

24. Carbon Footprint of AI & Dark Sides: https://lnkd.in/d_3qczK3

25. AI in Testing Roadmap - Step-by-Step Plan: https://lnkd.in/dBdV3-hx

26. Building Your Own Custom AI Chatbot for Testing: https://lnkd.in/dW36xuXY

27 AI Test Buddy & Possibilities: https://lnkd.in/dE3xbPdp


#testing #skilledtesting #youtube #rahulparwal #ai

Tuesday, 2 April 2024

Agile & Scrum

 AGILE VALUES

  • Individuals and interactions OVER processes and tools
  • Working software OVER comprehensive documentation
  • Customer collaboration OVER contract negotiation
  • Responding to changes OVER following a plan

Agile Principles

    1. Our highest priority is to satisfy the customer through early and continuous deliver of valuable software.

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

    3. Delivery working software frequently, from a couple of weeks to a couple of months, with a preference to the shorter timescale.

    4. Business people and developers must work together daily throughout the project.

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

    6. The most efficient and effective method of conveying information to and within a development team is face-to-face conversation.

    7. Working software is the primary measure of progress.

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

    9. Continuous attention to technical excellence and good design enhances agility.

    10. Simplicity – the art of maximizing the amount of work not done – is essential.

    11. The best architectures, requirements, and designs emerge from self-organizing teams.

    12. At regular intervals, the team reflects on how to become more effective, then tunes and adjusts it behavior accordingly.

# Define Scrum

Scrum is a lightweight framework that helps people, teams and organizations generate value through adaptive solutions for complex problems. Scrum employs an iterative, incremental approach to learn and adapt on the go, and create the highest value within the shortest time.

  • Product Backlog Refinement 
  • Product Backlog - Product Owner - Commitments 1 - Product Goal
  • Sprint Planning 
  • Sprint Backlog - Commitments 2 - Sprint Goal
  • Sprint - Scrum Team - Scrum Master - Product Owner - Developers
  • Daily Scrum 
  • Increment - Commitments 3 - Definition of Done
  • More Increments 
  • Sprint Review - Explore the Product, Impact and Adept
  • Spring Retrospective - Learnings, Opportunities and Experiments 


THREE ACCOUNTABILITIES 

  1. Developers
  2. Product Owner
  3. Scrum Master

FIVE EVENTS

  1. Sprint
  2. Sprint Planning
  3. Daily Scrum
  4. Sprint Review
  5. Sprint Retrospective

FIVE VALUES

  1.     Commitment
  2.     Focus
  3.     Respect
  4.     Openness
  5.     Courage





Object Oriented Programming In Java Questions And Answers - 3

 What is polymorphism?

  • Polymorphism is one of the major pillars of OOPs. 
  • It is a multiple form of a single entity.
  • It is process of performing a single task in different ways.
  • In polymorphism, one method have multiple forms based on the type of parameters, order of parameters, and number of parameters.
  • In simple words, Polymorphism is the ability of an object to take many forms. 

What are the types of polymorphism?

There are two types of polymorphism -

• Compile time polymorphism

• Run time polymorphism

What is compile time polymorphism?

  • The polymorphism that takes place during compile time is called compile time polymorphism. 
  • It is also called static polymorphism or early binding.
  • In this type of polymorphism, a class contain multiple methods having same name but different signatures.
  • Example of CTP - Method Overloading, Operator Overloading. 

What is runtime polymorphism? 

  • The polymorphism that takes place during run time is called compile time polymorphism. 
  • It is also called dynamic polymorphism or late binding. 
  • Runtime polymorphism refers to the process when a call to an overridden process is resolved at the run time.
  • In this type of polymorphism, the sub class and base class both contain methods having same name which can have different functionalities.

What is method overloading?

  • When a class contains multiple methods having same name but different signature, this is called method overloading. 
  • In method overloading, multiple methods of same names performs different tasks within the same class.
  • It depends upon the number and type of argument in the argument list and doesn't depend upon the return type of the method.
  • This is an example of compile time polymorphism. 
  • What is method overriding? 
  • When base class contain a method and sub class also contain same name method of its parent class, this is called method overriding. 
  • In other words, base class and subclass both have same name methods as well as signatures too. 
  • Method overriding is an example of run time polymorphism. 
  • Method overriding is used to provide the specific implementation of a method which is already provided by its superclass. 

What is operator overloading?

  • Operator overloading is a mechanism in which the operator is overloaded to provide the special meaning to the userdefined data type.
  • It is an example of compile time polymorphism. 

What is static function? 

  • Static functions are those functions that can be called without creating an object of the class. 
  • That means, Static methods do not use any instance variables of any object of the class they are defined in. 
  • Static methods can not be overridden. They are stored in heap space of the memory. 

What are virtual functions? 

  • Virtual function is a function or method used to override the behavior of the function in an inherited class with the same signature to achieve the polymorphism. Virtual function defined in the base class and overridden in the inherited class.
  • The Virtual function cannot be private, as the private functions cannot be overridden. 
  • It is used to achieve runtime polymorphism. 

 What are pure virtual functions? 

  •  A pure virtual function is that function which have no definition. 
  •  That means a virtual function that doesn't need implementation is called pure virtual function.
  •  A pure virtual function have not definitions but we must override that function in the derived class, otherwise the derived class will also become abstract class. 

 What is Constructor? 

  •  Constructor is a special type of member function which is used to initialize an object. 
  •  It is similar as functions but it's name should be same as its class name and must have no explicit return type.
  •  It is called when an object of the class is created. 
  •  At the time of calling constructor, memory for the object is allocated in the memory.
  •  We use constructor to assign values to the class variables at the time of object creation. 

 What are the types of Constructor?

 Constructor have following types -

  • Default constructor

  • Parameterized constructor

  • Copy constructor

  • Static constructor

• Private constructor

What is default constructor? 

A constructor with 0 parameters is known as default constructor. 

What is parameterized constructor?

The constructor method having the argument list or parameter list is called as parameterized constructor as it initializes the fields with the values of the parameters. 

What is copy constructor? 

A copy constructor is that constructor which use existing object to create a new object. It copy variables from another object of the same class to create a new object. 

What is static constructor? 

  • A static constructor is automatically called when the first instance is generated, or any static member is referenced.
  • The static constructor is explicitly declared by using a static keyword. 
  • However, the static constructor is not supported in Java. 

What is private constructor? 

  • Java enables us to declare a constructor as private. 
  • We can declare a constructor private by using the private access specifier. 
  • Note that if a constructor is declared private, we cannot create an object of the class.
  • Instead, we can use this private constructor in Singleton Design Pattern. 

What is destructor?

  • Destructor is a type of member function which is used to destroy an object. 
  • It is called automatically when the object goes out of scope or is explicitly destroyed by a call to delete.
  • It destroy the objects when they are no longer in use. 
  • A destructor has the same name as the class, preceded by a tilde (~). 

What is Constructor Overloading? 

  • The constructor method of the class may or may not have the argument list, and it has no return type specified and
  • we also know that method overloading depends only on the argument list and not on the return type. 
  • Thus, we can say that the constructor method can be overloaded. 

Object Oriented Programming In Java Questions And Answers -2 (Inheritance)

 What is inheritance? 

  • Inheritance is a very powerful feature of OOPs. 
  • It is amechanism of acquiring properties or behaviors of existing class to a new class. 
  • In other words, A class inherits data fields or methods from another class. 
  • This helps to write redundant free code and also reduces code length.
  • For eg. Animal is a class and other classes like Dog, cat etc. can inherit the common properties of animal class.

Why we use inheritance? 

Inheritance provides following benefits -

    • Code reusability

    • Less development and maintenance costs

    • Reduces code redundancy and supports code extensibility

    • Save time and effort to write codes

What is superclass?

  • Super class is that class which is inherited by other class.
  • In other words, super class is a class from which sub class inherits the properties and behaviors. 
  • It is also called base class or parent class. 

What is a subclass? 

  • Sub class is that class which inherits other class. 
  • In other words, sub class is a class which inherits the properties and behaviors of super class. 
  • It is also called child class or derived class. 

What are the types of inheritance? 

Inheritance have following types -

• Single inheritance

• Multiple inheritance

• Multilevel inheritance

• Hierarchical inheritance

• Hybrid inheritance 

What is single inheritance? 

  • When a class inherits properties and behavior of only one class then this type of inheritance is called single inheritance.
  • In other words, in single inheritance there is only one base class and only one sub class. 

What is multilevel inheritance?

  • When a class inherits other class and then that inherited class further inherited by other class, this type of inheritance is called multi level inheritance.
  • In multilevel inheritance , sub class contains the properties of the base class as well as the properties of base class of its own class.

What is multiple inheritance?

  • When a class inherits the properties and behaviors of more than one class and then this type of inheritance is called multiple inheritance.
  • In multiple inheritance, there is only one sub class but more than one super class.
  • Java does not support multiple inheritance.

What is hierarchicachical inheritance?

  • When more than one class inherits the properties or behavior of only one class then this type of inheritance is called hierarchical inheritance.
  • In hierarchical inheritance , there are only one parent class but many child class.

What is hybrid inheritance?

  • Hybrid inheritance is a combination of more than one type of inheritance.

Why Java doesn't support multiple inheritance? 

Java doesn't support multiple inheritance because of following reasons -

  • Ambiguity Around The Diamond Problem
  • Multiple inheritance does complicate the design and creates problem during casting, constructor chaining etc.
  • So to simplify the language and reduce code complexity, Java doesn't support multiple inheritance. 

What is the difference between multiple and multilevel inheritance?

Multiple Inheritance

    1. In multiple inheritance, one sub class inherits the properties and behaviors of more than one super class.

    2. It has two class levels namely, base class and derived class.

    3. It inherits from the base class.

Multilevel Inheritance

        1. In multilevel inheritance, a class inherits other class and then that inherited class further inherited by other class.

        2. It has three class levels namely, base class, intermediate class and derived class.

        3. It inherits from the derived class.

What are the limitations of inheritance?

    • Decreases Execution Speed - Inheritance execution takes time and effort so it decreases the execution speed of code.

    • No Independence - Inheritance increases the coupling between base class and derived class. A change in base class will affect all the child classes.

    • Uncertainty of results - Improper use of inheritance may lead to wrong solutions.

    • Memory wastage - Often, data members in the base class are left unused which may lead to memory wastage 


Object Oriented Programming In Java Questions And Answers - 1

What is OOPs? 

  • OOPs stands for Object-Oriented Programming system. 
  • It is a programming paradigm in which software design involves around data, or objects, rather than functions and logic. 
  • In OOPs, objects are data fields that have unique attributes and properties. 
  • OOPs focuses on the objects that developers want to manipulate rather than the logic required to manipulate them. 
  • That's why large, complex and actively updated or maintained program is well suited for OOPs paradigm of programming.

  • It is based on objects.
  • It is based on real world.
  • It provides data hiding so it is very secure.
  • It provides reusability feature.
  • Eg. C++, Java, python etc.


What are the basic features of OOPs? 

    • Encapsulation

    • Inheritance

    • Polymorphism

    • Abstraction

Why use OOPs?

OOPs provide the following advantages, that's why it is used.

    • Code maintenance

    • Reusability

    • Security

    • Better productivity

    • Polymorphism flexibility

    • Problem solving

    • Easy troubleshooting

    • Design benefits

    • Data redundancy 

What is a class? 

  • A class is a collection of objects. Classes don’t consume any space in the memory.
  • It is a user defined data type that act as a template for creating objects of the identical type. 
  • Once a class has been defined. A large number of objects can be created using the same class. 
  • Therefore, Class is considered as the blueprint for the object. 

eg. 

  • Fruit is a class and its objects are mango, apple etc. 
  • Furniture is a class and its objects are table, chair, desk etc. 

Syntax : 

class classname [extends inheritance]

{

[field declararion]

[method declaration]

What is an object? 

  • An object is a real world entity which have properties and functionalities.
  • Object is also called an instance of class. Objects take some space in memory.
  • For eg. car, table, chair etc. are the example of objects.

Syntax of creation of object :

classname obj_reference = new classname(); 

Step I - classname obj_reference; // object declararion

Step II - obj_reference = new classname(); //object initialization

What is the difference between a class and an object? 

Class :

  •  It is a collection of objects.
  •  It doesn't take up space in memory.
  •  Class does not exist physically
  •  Classes are declared just once
  •  Eg. - Fruit, Vehicle, Laptop

Object

  •  It is an instance of a class.
  •  It takes space in memory.
  •  Object exist physically.
  •  Objects can be declared as and when required
  •  Eg. - Mango, Car, HP Laptop

What is encapsulation?

  • Encapsulation is an striking feature of OOPs that provides data security. 
  • It is a mechanism of binding member data and member function together into a single place i.e. class.
  • The main advantage of encapsulation is that data is hidden and protected from access by outside non-member methods of a class. 
  • In other words, only member functions defined in a class will have access to the data.
  • In encapsulation, data(variables) are declared as private and methods are declared as public. 

What are access specifiers? 

  • Access specifiers are the most important part of object oriented programming paradigm. 
  • It allows us to restrict the scope or visibility of a package, class, constructor, methods, variables, or other data members.
  • By using access specifiers, we define how the members (attributes and methods) of a class can be accessed. 

There are three types of most common access specifiers, which are following.

• Private

• Public

• Protected 

What is the difference between public, private and protected access modifiers?

Public Modifiers - When we declare any class, variable or method with public modifiers that means that class, variable or method is accessible throughout from within or outside the class, within or outside the package, etc.

It provides highest level of accessibility.

Private Modifiers - When we declare any class, variable or method with private modifiers that means that class, variable or method is not accessible from within or outside the class, within or outside the package, etc.

Private field or method can't be inherited to sub class. 

This provides lowest level of accessibility. 

Protected Modifiers - When we declare any class, variable or method with protected modifiers that means that class, variable or method is accessible from classes in

the same package, sub-classes in the same package, subclasses in other packages but not accessible from classes in other packages. 

What is data abstraction?

  • Data abstraction is an important feature of OOPs that allows to hide unnecessary data from the user. 
  • This reduces program complexity efforts.
  • This means that it displays only the necessary information to the user and hides all the internal background details.
  • For example, when we order anything in a restaurant, we get our orders but we don't know all the background work that has been taken to process this order.
  • If we talk about data abstraction in programming language, the code implementation is hidden from the user and only the necessary functionality is shown or provided to the user. 

How to achieve data abstraction? 

We can achieve data abstraction by using -

1. Abstract class

2. Interface 

What is an abstract class? 

  • Abstract class is that class which contains abstract method. 
  • Abstract methods are those methods which have only declaration not the implementation.
  • An abstract class is declared with abstract keyword. 
  • An abstract class can also contain non-abstract methods.

What is an interface? 

  • An interface is a collection of abstract method (methods without definition). 
  • We can't instantiate an interface.
  • Interface only contains the final fields and abstract methods not the regular methods. 
  • Interface also don't contain constructor. 
  • The member of the class may or may not be private but the members of the interface can never be private.
  • The abstract method of the interface must be overridden in its child classes and the interface supports the concept of multiple inheritance which was not supported using the classes.
  • An interface can't be extended by class, it can only be implemented by class. 

Syntax : 

interface interfacename

{

 [final field declaration]

 [abstract method declaration]

Differentiate between data abstraction and encapsulation.

Data Abstraction:

    1. In data abstraction, we hide unnecessary information from the user and only show the necessary information.

    2. Abstraction is implemented using abstract class and interfaces.

    3. Data abstraction is implemented at the design or interface level

Encapsulation

    1. In encapsulation, we combine data and functions together at a single unit i.e. class.

    2. Encapsulation is implemented using access modifiers such as rivate, public and protected.

    3. Encapsulation is implemented at the implementation level.

Can we create an instance of an abstract class? 

No,  instance of an abstract class can't be created.

Salesforce AI Associate Certification - 3

What is semantic retrieval in the context of LLMs?   Searching for relevant information in other data sources What additional protection do...