Skip to main content

Verification Engineer or Senior Verification Engineer SOC at MIPS India

Hello Dear Readers, Currently, at MIPS India  vacancy for a Verification Engineer or Senior Verification Engineer SOC role. We are seeking an experienced Verification Engineer or Senior Verification Engineer SOC. This position involves extensive hands-on experience with CPU verification using industry-standard functional verification methodologies, formal verification, and constrained random generators, and reference model-based checkers. The candidate must be able to take critical decisions and completely own verification closure for a block or feature. This position involves cross-functional interaction with CPU designers and architects and working across sites to ensure high-quality CPU designs for customers. You will: Take full ownership and drive verification efforts to closure Work closely with designers and architects to understand specifications at unit/top level Understand use cases and develop functional test plans Develop directed tests written in C, Assembly, and SystemVeri

Pytest for Functional Test Automation with Python

 Hello Dear Readers, 

Today in this post I will provide some deep insight into what is happening in the semiconductor industry. So hope you like it and enjoy it to improve your knowledge and awareness about the industry. So let's start it today we are discussing, Pytest for Functional Test Automation with Python framework.

Today’s modern businesses require faster software feature releases to produce high-quality products and to get to market quickly without sacrificing software quality. To ensure successful deployments, the accelerated release of new features or bug fixes in existing features requires rigorous end-to-end software testing. While manual testing can be used for small applications or software, large and complex applications require dedicated resources and technologies like python testing frameworks, automation testing tools, and so on to ensure optimal test coverage in less time and faster quality releases. PyTest is a testing framework that allows individuals to write test code in Python. It enables you to create simple and scalable test cases for databases, APIs, and user interfaces. PyTest is primarily used for writing API tests. It aids in the development of tests ranging from simple unit tests to complex functional tests. According to a report published by future market insights group, the global automation testing market is expected to grow at a CAGR of 14.3% registering a market value of US$ 93.6 billion by the end of 2032. 

Why choose Pytest?

Selection of the right testing framework can be difficult and relies on parameters like feasibility, complexity, scalability, and features provided by a framework. PyTest is the go-to test framework for a test automation engineer with a good understanding of Python fundamentals. With the PyTest framework, you can create high-coverage unit tests, complex functional tests, and acceptance tests. Apart from being an extremely versatile framework for test automation, PyTest also has a plethora of test execution features such as parameterizing, markers, tags, parallel execution, and dependency.

  • There is no boilerplate while using Pytest as a test framework
  • Pytest can run tests written in unittest, doctest, and nose
  • Pytest supports plugins for behavior-driven testing
  • There are more than 150 plugins available to support different types of test automation

The diagram below shows a typical structure of a Pytest framework.

As shown above, in the structure, the business logic of the framework core components is completely independent of Pytest components. Pytest makes use of the core framework just like instantiating the objects and calling its functions in the test script. Test script file name should either start with `test_` or end with `_test`. The test function name should also be in the same format. Reporting in Pytest can be taken care of by Pytest-html reporting.

Important Pytest features

1. Pytest fixtures

The most prominently used feature of Pytest is Fixtures. Fixtures, as the name suggests are decorator functions that are used in pytest to generate a specific condition that needs to be arranged for the test to be run successfully. The condition can be any precondition like creating objects of the classes required, bringing an application to a specific state, bringing up the mockers in case of unit tests, initializing the dependencies, etc. Fixtures also take care of the teardown or reverting of the conditions that were generated after the test execution is completed. In general, fixtures take care of the setup and teardown conditions for a test.

Fixture scope:

The setup and teardown do not have to be just for the test function. Scope of the setup may differ from a test function to as large as the whole test session. This means the setup-teardown is executed only once per defined scope. To achieve the same, we can define the scope along with the fixture decorator i.e., session, module, class, function.

Fixture usage:

Pytest provides the flexibility to use a fixture implicitly or call it explicitly, with autouse parameter. To call the fixture function by default, the autouse parameter value needs to be set to True, else to False.

2. Conftest.py

All the fixtures that are to be used in the test framework are usually defined in conftest.py. It is the entry point for any Pytest execution. Fixtures need not be autouse=True. All defined fixtures can be accessed by all the test files. conftest.py needs to be placed in the root directory of the Pytest framework.

3. Pytest hooks

Pytest provides numerous hooks that will be called in to perform a specific setup. Hooks are generator functions that yield exactly once. Users can also write wrappers in conftest for the Pytest hooks.

4. Markers

Pytest provides markers to group a set of tests based on feature, scope, test category, etc. The test execution can be auto-filtered based on the markers. i.e., acceptance, regression suit, login tests, etc. Markers also act as an enabler for parameterizing a test. The test will be executed for all the parameters that are passed as the argument. Note, Pytest considers a test for one parameter as a completely independent test. Many things can be achieved with markers like marking a test to skip, skipping on certain conditions, depending on a specific test, etc.

5. Assertion

Pytest does not require the test scripts to have their assertions. It works flawlessly with Python inbuilt assertions.

6. Pytest.ini

All default configuration data can be put in pytest.ini and the same can be read by the conftest without any specific implementation.

PyTest supports a huge number of plugins with which, almost any level of a complex system can be automated. A major benefit of Pytest is that any kind of implementation of the structure is done using raw Python code without any boilerplate code. It means implementing anything in Pytest is as flexible and clean as implementing anything in Python itself.

Amidst shorter development cycles, test automation provides several benefits that are critical for producing high-quality applications. It reduces the possibility of unavoidable human errors taking place during manual testing methods. Automated testing improves software quality and reduces the likelihood of defects jeopardizing delivery timelines.


Credit for the article: Rahul Vala 

About the Author:

Rahul is working as a Principal Engineer at Softnautics and has a total of 10 years’ experience in Test Automation of different types of systems like embedded firmware, mobile and enterprise web applications. He has developed several complex Test Automation frameworks involving complex products and multiple components like boards, mobile devices, GPIO Controls, R Pi, cloud APIs, etc. He is passionate about pytest automation and loves to debug and find the root cause of complex issues.


Connect with me 










Comments

  1. Useful content thanks for your efforts

    ReplyDelete
  2. Hello nishitbhai samaj nahi aa raha hai itni bhari language thoda simple samaja skate ho example k sath.
    Thanks by heart for your efforts.

    ReplyDelete

Post a Comment

Popular posts from this blog

SDC (Synopsys Design Constraints) contents part 4

Today, we will be discussing the remaining constraints mentioned in the SDC, which pertain to timing exceptions and design rules. This is the final part of the SDC contents. This is going to be interesting, especially with multicycle paths. Take time to read and try to comprehend. 10. set_max_transition     By setting max transition value, our design checks that all ports and pins are meeting the specified limits mentioned in SDC. If these are not satisfied then timing report will give DRVs (design rule violations) in terms of slack. This is specified as               set_max_transition 0.5  UBUF1/A setting maximum limit of 500ps on pin A of Buffer1. 11. set_max_capacitance     This is same as max transition, setting the maximum capacitance value. if our design not meeting this value then violation will occur. This will also reports under design rule violations in terms of slack.     set_max_capacitance 0.7 [all_nets] setting maximum capacitance of 700fF on all nets. similarly, set_max

Apprenticeship CAI at MediaTek Bangalore

Hello Dear Readers,   Currently at MediaTek Bangalore vacancy for an Apprenticeship CAI role. Job Description: B.Tech degree in Electrical/Electronics Engineering with a strong educational background in Digital circuit design Experience in physical design of high performance design with frequencies > 2 Ghz. Experienced in hierarchical design, budgeting, multiple voltage domains and multiple clock domains. Strong skills with Cadence Encounter. Solid understanding of STA and timing constraints. Experienced in working on advanced process nodes (16nm). Strong expertise in Physical Verification to debug LVS/DRC issues at the block level. Requirement: B.Tech degree in Electrical/Electronics Engineering with strong educational background in Digital circuit design Experience in physical design of high performance design with frequencies > 2 Ghz. Experienced in hierarchical design, budgeting, multiple voltage domains and multiple clock domains. Strong skills with Cadence Encounter. Solid

IC Physical Design (PnR) at Ulkasemi

Hello Dear Readers,   Ulkasemi  has a vacancy for an IC Physical Design (PnR) role. Job Overview: As a full-time Trainee Engineer, the individual will be working on IC Physical Design implementation from RTL to GDSII to create design databases ready for manufacturing with a special focus on power, performance & area optimization with next-generation state-of-the-art process technologies. Job Responsibilities: Perform physical design implementation which includes Floor planning, Power Planning, Clock Tree Synthesis, Place and Route, ECO, Logic Equivalence checks Timing analysis, physical & electrical verification, driving the sign-off closure meeting schedule, and design goals Develop flow, methodologies, and automation scripts for various implementation steps Follow the instructions, compile documents, prepare deliverables, and report to the team lead Should remain up to date with the latest technology trends Educational Qualification:   B.Sc/M.Sc   in EEE or equivalent degree