Behavior Modeling, Software Development, and Testing: The Role of AI

At a Glance
  • Large Language Models (LLMs) are leveraged to enhance Advanced Software-Defined Lifecycle (ASDL) processes, improving automation and decision-making in automotive software development.
  • Generative AI is streamlining all stages of the Software Development Life Cycle (SDLC), from requirements gathering and coding to testing and deployment; resulting in faster, more efficient development.
  • A proof-of-concept for human behaviour modelling demonstrated AI’s ability to accurately simulate driver behaviour, enhancing automotive software reliability and safety.

The rapid evolution of the automotive industry is marked by trends like ECU consolidation, and SDVs adding complexity to software development and validation. With the global automotive software and electronics market projected to reach $462 billion by 2030, according to a recent McKinsey report and vehicles becoming more connected and intricate, there is great scope for OEMs and Tier 1 suppliers to innovate and deliver advanced solutions to the market more swiftly. Discover how generative AI is shaping the future of automotives by transforming software design, development, and validation.

Automotive Software Development Lifecycle

Automotive SPICE (Software Process Improvement and Capability determination) is a framework used within the automotive industry to assess and enhance the maturity of software development processes. Originating from the ISO/IEC 15504 standard, ASPICE provides a methodology for evaluating the processes involved in the development of automotive systems with a specific focus on software and system integration.

Engineer Designing Automotive Software

These include processes for system design, software design, implementation, integration, verification, and validation. By adhering to the ASPICE standards, automotive companies can achieve higher levels of process maturity, leading to improved product quality, enhanced project predictability, and reduced development costs.

Sequential and Interdependent Nature of the ASPICE Processes
Figure 1. Sequential and Interdependent Nature of the ASPICE Processes

The above figure is integral in understanding the sequential and interdependent nature of the ASPICE processes, offering a clear pathway for organisations to follow to enhance their development practices and fulfil the high-quality standards demanded in the automotive industry.

This step-by-step approach ensures that the system is developed and tested thoroughly before moving to the next stage, maintaining a high standard of quality and functionality in the final product. However, this process is inherently manually intensive, requiring significant human effort and expertise.

New-age technologies like generative AI offer a transformative solution by automating the generation of some key artefacts throughout this lifecycle. This technological augmentation not only speeds up the development process but also enhances precision, reducing the likelihood of human error.

LLM Training Techniques for the Automotive Software Development Lifecycle

To harness the full potential of generative AI in the automotive software development lifecycle, specific techniques are utilised: 

  • Retrieval-Augmented Generation (RAG): This technique enhances AI responses by combining pre-trained language models with retrieved documents relevant to a query. It’s particularly useful in generating accurate and context-aware responses in requirements engineering, code generation, and testing phases. 
  • Contextual Learning: This involves training AI models on specific contexts or scenarios to ensure that the generated outputs are highly relevant and tailored to particular needs.  Contextual learning can be used for requirement review, code review and for generating new artefacts when specific context is available.  
  • Prompt Engineering: This technique involves crafting inputs to the AI model that guide it to produce the most useful and accurate outputs. Effective prompt engineering is essential for maximising the efficiency of generative AI across all lifecycle stages.  

Generative AI in Enhancing the Software Development Lifecycle

Integrating generative artificial intelligence into the Software Development Lifecycle (SDL) offers transformative potential, enhancing efficiency and innovation across various stages. Generative AI algorithms can dynamically create, enhance, and optimise key artefacts, from requirements to testing scenarios, fostering a more agile and intelligent development lifecycle. The below table showcases how generative AI will augment various ASPICE stages.

Stage - Requirements Elicitation (SYS.1)

Generative AI Strategy

RAG, Contextual learning can be used for generating new requirements based on previous requirements, system excerpts, domain knowledge database, stakeholder requirements.

Stage - System Requirements Analysis (SYS.2)

Generative AI Strategy

Augment existing requirements, providing a broader analysis of potential scenarios. Review of requirements for logical correctness, completeness, testability, compliances with legal norms etc. are evaluated with the help of Large Language Models.

Stage - System Architectural Design (SYS.3)

Generative AI Strategy

AI-driven generative design tools can explore diverse architectural possibilities, generating multiple design alternatives.

Stage - Software Requirements Development (SWE.1)

Generative AI Strategy

Generate additional software requirements, incorporating diverse perspectives and functionalities. RAG and contextual learning enable users to provide proper and relevant context including historical software requirements as input for generating new software requirements.

Stage - Software Architectural Design (SWE.2)

Generative AI Strategy

Gen AI models can produce software architecture diagrams based on system and software requirements.

Stage - Software Detailed Design and Unit Construction (SWE.3)

Generative AI Strategy

Neural networks can generate code snippets or functions based on design specifications, accelerating coding. Prompt engineering could also guide engineers in analysing code structures and providing relevant suggestions for efficiency and optimisation.

Stage - Software Unit Verification (SWE.4)

Generative AI Strategy

Automatically generate diverse test cases and test scripts based on specifications and code structures, ensuring coverage.

Stage - Software Integration and Integration Test (SWE.5)

Generative AI Strategy

Generate synthetic data sets to simulate integration scenarios, facilitating comprehensive testing. Test automation can also be facilitated with Gen AI where the required test scripts are generated.

Stage - Software Qualification Test (SWE.6)

Generative AI Strategy

Gen AI can automatically generate test scripts for software qualification testing, streamlining the process. Proper contextual data including software requirements can be provided to enable efficient test case and test script generation.

Stage - System Integration Test (SYS.4)

Generative AI Strategy

Generate diverse integration scenarios based on specifications like system architecture diagram and hardware software interface specifications, enabling thorough testing under various conditions.

Stage - System Qualification Test (SYS.5)

Generative AI Strategy

Using inherent system knowledge and additional contextual test cases, Gen AI can be used for generating new system qualification test cases which can assure test coverage and traceability.

Leveraging GitHub Copilot for Efficiency and Speed

GitHub Copilot

For example, Tata Elxsi is leveraging Large Language Models to streamline ASPICE processes, significantly accelerating development timelines and ensuring efficient, high-quality project outcomes such as: 

  • Requirement Generation for EV Charging Functionality (SWE 1): Using GenAI, Tata Elxsi created a requirement document in 7 minutes, a task that usually took about 20-30 minutes. 
  • Code Design for Sensor Fusion System (SWE 3): For the detailed creation of design documents, code design, and writing code for 25 functions, development time was reduced from 6 months to approximately 3 months and 20 days. 
  • Test Case Development (SWE 4): Writing and testing 1000 test cases to cover all possible scenarios, including corner cases, was reduced from 4 months to 2 months. 
  • End-to-end Code Creation and Debugging (SWE 5): The time for creating and debugging end-to-end code for test case generation of EV charging functionalities in various scenarios was reduced from 1-2 hours to 3-5 minutes.

Generative AI : Solutions Available from Tata Elxsi

AI in Action - Tata Elxsi's PoC for Human Behaviour Modelling

Tata Elxsi leverages GenAI for human behaviour modelling in automotive applications. By simulating how humans interact with vehicle electronic systems, they can generate realistic test scenarios that are hardware and software agnostic. Large Language Models (LLMs) inherently capture human behavioural aspects, eliminating the need for pretraining. This approach enhances the development and testing of automotive systems, ensuring they meet real-world user interactions effectively.

The architecture of the proposed Gen AI framework for human behavioural modelling and test case generation is shown in the following figure.

Architecture of the Proposed Gen AI Framework for Human Behavioural Modelling and Test Case Generation
Figure 2. Architecture of the Proposed Gen AI Framework for Human Behavioural Modelling and Test Case Generation

Here’s how the modelling is done using the example prompt “Generate test steps for the car’s voice command system when asked about current traffic conditions”:

  1. Prompt Engineering

Example Prompt: “Generate test steps for the car’s voice command system when asked about current traffic conditions.” 

    • Context: Provides relevant background information. 
    • Task: Specifies the action to be performed.

Details: Fine-tuning the prompt ensures the model understands the task. For instance, it includes both context (voice command system behaviour) and the specific task (asking about traffic conditions).

2. LangChain Interaction 

Framework Use: LangChain with GPT-3.5-Turbo 

Example Interaction: The prompt is processed to generate detailed test steps. 

Details: The LangChain framework interacts with the LLM, generating realistic and detailed scenarios. For the provided prompt, the system might generate steps like: 

    1. Initiate the voice command system. 
    2. Ask for current traffic conditions.
    3. Observe the response time and accuracy. 
    4. Check for appropriate updates in navigation. 

3. Storage 

Database: MySQL 

Example Storage Structure:

    • Columns: prompt, scenario, test case, category, subcategory 
    • Example Entry: 
      • Prompt: “Generate test steps for the car’s voice command system when asked about current traffic conditions.” 
      • Test Case: Detailed steps generated. 
      • Category: Voice Command 
      • Subcategory: Traffic Inquiry

Details: The generated test scenarios are stored in a structured database for easy retrieval and analysis. 

4. User Interface 

Platform: Streamlit 

Example UI:

    • Columns: prompt, scenario, test case, category, subcategory 
    • Example Entry: Visualises and interacts with stored scenarios. 
      • Functionality: Users select a category and subcategory to view relevant test scenarios.
      • Example View: Display the test steps for the voice command prompt.
    •  

Details: The UI allows users to interact with and visualise the test scenarios, making the data accessible and actionable. 

By following these steps, Tata Elxsi enhances the development and testing of automotive systems through realistic and relevant human behaviour modelling.

Future Perspective

Looking ahead, AI is anticipated to become a cornerstone in the automotive development lifecycle within the next few years, automating many tasks that are currently manual. This shift is expected to dramatically increase efficiency, reduce costs, and improve the overall quality of automotive software.

Organisations are heavily investing in AI for the development lifecycle and testing, with GenAI expected to be embedded in all stages of the software development lifecycle within a few years. Moreover, OEMs and Tier 1 suppliers are now envisioning roadmaps where GenAI assumes functions traditionally performed by humans, promising unprecedented levels of automation and creativity in software engineering.

The journey will require overcoming substantial challenges, but the potential rewards justify the efforts, promising a future where AI-driven methodologies become standard practice in automotive development.

Author

Dr. Jihas Khan

Practice Head- Virtualisation, Tata Elxsi

Dr. Jihas Khan is the Practice Head for Virtualisation at Tata Elxsi with over 13 years of expertise in autonomous driving, electric vehicles, and AI for automotive applications. A PhD graduate from NIT Calicut, he has authored 50+ research papers and patents. His work includes global projects on automotive embedded systems, virtual ECU development, and cloud solutions. A recognised speaker and trainer, Dr. Khan has presented at major international conferences and led over 100 training sessions.