AI-Assisted Development and Emerging PracticesIntroductionSoftware development is increasingly supported by artificial intelligence, cloud-native architectures, automation platforms and intelligent applications. For Java and Python developers, these changes create opportunities to improve productivity, testing, documentation and system reliability. They also introduce risks: generated code may be incorrect, insecure, biased, poorly licensed or unsuitable for the intended environment. AI-assisted development therefore does not mean accepting machine-generated output without question. It means using AI as a development aid while retaining human responsibility for requirements, design, verification, security, ethics and maintenance. This chapter examines responsible generative AI use and several important emerging practices: microservices, serverless computing, platform engineering, intelligent applications and likely developments in Java–Python development. Learning ObjectivesBy the end of this chapter, a learner should be able to: - Explain how generative AI can support coding, testing and documentation.
- Verify AI-generated outputs using technical, security and quality criteria.
- Apply a responsible workflow for AI-assisted programming in Java and Python.
- Compare monolithic, microservices, serverless and platform-engineered systems.
- Describe how intelligent applications combine software with models, data and retrieval mechanisms.
- Evaluate emerging Java–Python practices using maintainability, cost, performance, governance and risk.
1. Generative AI in Software DevelopmentGenerative AI systems produce text, code, test cases, documentation, diagrams or configuration from prompts and contextual information. Large language models commonly generate code by predicting likely sequences from patterns learned from large datasets. They do not automatically understand a project’s business purpose, security obligations or operational environment. AI tools can assist with: - explaining unfamiliar Java or Python code;
- generating method or class templates;
- converting code between languages;
- suggesting unit and integration tests;
- identifying possible defects;
- drafting API documentation and README files;
- producing SQL, regular expressions and configuration files;
- summarising logs or issue reports.
The correct professional attitude is augmentation rather than replacement. A developer remains accountable for the resulting software, even when an AI system produced much of its source code. 1.1 Prompt quality and contextA useful prompt states the task, language version, framework, input and output requirements, constraints and expected error handling. For example: “Write a Java 21 method that parses an ISO-8601 date. Return a validation result rather than throwing an exception for invalid input. Include JUnit 5 tests for valid, invalid and boundary cases. Do not use external libraries.” This prompt is more useful than “write a date parser” because it supplies constraints that can be checked. Sensitive information such as passwords, private customer records, proprietary source code and confidential architecture should not be entered into an AI service unless the organisation has explicitly approved the service and its data controls. 1.2 Common failure modesAI-generated code can: - call an API incorrectly or use an obsolete version;
- omit validation and error handling;
- contain race conditions or injection vulnerabilities;
- use inefficient algorithms or excessive memory;
- invent libraries, methods, citations or configuration settings;
- reproduce insecure examples from training data;
- misunderstand domain rules;
- generate tests that merely repeat implementation assumptions;
- include licensing or attribution concerns.
A fluent explanation is not evidence of correctness. Compilation is also not proof of correctness: a program may compile while producing wrong results or exposing data. 2. A Responsible AI-Assisted WorkflowA disciplined workflow separates generation from acceptance. Step 1: Define the requirementState the behaviour, inputs, outputs, constraints, quality attributes and failure conditions. Ambiguous requirements produce ambiguous code. Where possible, express acceptance criteria as observable examples. Step 2: Choose the appropriate taskAI is useful for repetitive scaffolding, alternative implementations and explanatory drafts. It is less suitable as the sole authority for cryptography, safety-critical control, legal interpretation, security architecture or irreversible production changes. Step 3: Generate a small, reviewable outputAsk for one function, class, test group or documentation section rather than an entire application. Small outputs reduce hidden assumptions and make review easier. Step 4: Inspect and verifyThe developer should check: - Functional correctness: Does the implementation satisfy the requirements and edge cases?
- Compilation and execution: Does it build with the specified versions?
- Testing: Do independent tests pass, including negative and boundary cases?
- Security: Are input validation, authentication, authorisation, secrets and dependencies handled safely?
- Performance: Are time, memory, network and database costs acceptable?
- Maintainability: Is the code readable, modular and consistent with project conventions?
- Legal and governance compliance: Is use of the output compatible with organisational policy and applicable licences?
Step 5: Integrate normal engineering controlsUse version control, peer review, static analysis, dependency scanning, continuous integration and reproducible builds. AI-generated changes should be visible in commits and reviewed like any other contribution. Step 6: Record provenance and decisionsTeams should record the tool, relevant prompt or task description, human review, tests performed and unresolved risks when the organisation requires traceability. Documentation should describe what the software does, not claim that it is correct merely because an AI system generated it. Verification matrix| Output | Useful verification methods |
|---|
| Java or Python code | Build, unit tests, integration tests, static analysis, review | | Test cases | Mutation testing, requirement comparison, boundary analysis | | Documentation | Execution against the documented procedure, link checking, peer review | | SQL or configuration | Least-privilege review, staging deployment, security scanning | | AI explanation | Compare with official language and framework documentation |
3. AI-Assisted Coding, Testing and Documentation3.1 CodingAI can generate a first draft of a Python data class, a Java REST controller or an adapter around an external service. Developers should then simplify the result and align it with existing architecture. Generated abstractions are not automatically valuable; unnecessary layers increase maintenance cost. A particularly important practice is to request explicit assumptions. For example, a function that divides values should specify whether a zero divisor is rejected, represented as a special result or handled by a domain rule. The same principle applies to null values in Java and None values in Python. 3.2 TestingAI can suggest tests, but tests must be derived from requirements rather than copied from the implementation. Effective test design includes: - normal cases;
- boundary values;
- invalid types and formats;
- empty or missing input;
- permission failures;
- network and database failures;
- repeatability and concurrency where relevant.
For a function that accepts a percentage, tests should examine values below zero, between zero and one hundred, exactly at the boundaries and values above one hundred if those values are invalid. Generated tests should be reviewed for assertions that are too weak, such as checking only that no exception occurs. 3.3 DocumentationAI is effective at producing a first draft of docstrings, JavaDoc, API examples and release notes. Documentation must be checked against actual behaviour. A useful documentation review asks: - Does every parameter and return value have the correct meaning?
- Are exceptions and error responses accurate?
- Are examples executable or at least syntactically valid?
- Are security and privacy requirements stated?
- Does the documentation match the installed version?
4. Architectural EvolutionA software architecture determines how components are organised, deployed and operated. No architecture is universally superior; the appropriate choice depends on team capability, domain boundaries, traffic patterns, reliability requirements and operational budget. 4.1 MonolithsA monolith packages many functions as one deployable unit. It is often straightforward to develop, test and deploy initially. Its disadvantages may include large release scope, difficult scaling of one function independently and stronger coupling between modules. A well-modularised monolith can remain a sensible choice for small teams and stable systems. 4.2 MicroservicesA microservices architecture divides an application into independently deployable services organised around business capabilities. A service usually owns its code and may own its data. Communication can use HTTP APIs, messaging or other protocols. Benefits include independent deployment, selective scaling, technology flexibility and fault isolation. Costs include distributed-system complexity, network failure, observability requirements, data consistency challenges, deployment overhead and the need for stronger platform automation. Important design principles include: - define service boundaries around business capabilities, not merely technical layers;
- keep APIs explicit and versioned;
- design for timeouts, retries and partial failure;
- avoid uncontrolled shared databases;
- use correlation identifiers and centralised observability;
- automate deployment and rollback;
- secure service-to-service communication.
A retry policy must be used carefully. Retrying a non-idempotent operation can create duplicate orders or payments. Backoff, timeout and circuit-breaker policies should be based on the operation and failure mode, not copied mechanically from a template. 4.3 Serverless computingServerless computing allows developers to deploy functions or managed services while the cloud provider manages much of the infrastructure. “Serverless” does not mean that servers do not exist; it means that their provisioning and operation are largely abstracted from the application team. Advantages include rapid deployment, automatic scaling for suitable workloads and payment models based partly on usage. Limitations include cold-start latency, execution limits, vendor dependence, distributed debugging, unpredictable cost at high volume and restrictions on long-running or stateful processing. Java functions may benefit from compilation and runtime optimisation techniques, while Python often supports rapid development and a broad data and AI ecosystem. Actual performance depends on workload, runtime configuration, dependencies and provider implementation; language stereotypes are not substitutes for measurement. 4.4 Platform engineeringPlatform engineering creates an internal developer platform that provides approved, reusable paths for building, testing, deploying and operating services. A platform may include templates, CI/CD workflows, container orchestration, secrets management, observability and policy checks. The platform should reduce cognitive load without hiding important operational facts. Good platforms offer a “paved road” rather than an unchangeable road: teams can use defaults while retaining justified alternatives. Platform success can be evaluated through deployment lead time, failure recovery, developer satisfaction, reliability and security findings, not simply the number of tools installed. 5. Intelligent ApplicationsAn intelligent application uses models or AI-enabled services as part of a wider software system. It normally contains more than a model call. It may include data ingestion, preprocessing, retrieval, prompt construction, model invocation, validation, user interaction, monitoring and feedback. A common pattern is retrieval-augmented generation (RAG). At query time, the application retrieves relevant documents from an indexed knowledge base and supplies them as context to a language model. Retrieval can improve access to organisation-specific information, but it does not guarantee truth. Poor indexing, stale documents, prompt injection and irrelevant retrieval can still produce unsafe answers. Responsible intelligent applications should include: - defined use cases and prohibited uses;
- protection of personal and confidential data;
- access control for retrieved documents;
- output validation and confidence-aware handling;
- human review for high-impact decisions;
- logging that avoids unnecessary sensitive content;
- evaluation datasets representing normal, difficult and harmful cases;
- monitoring for drift, cost, latency and quality.
Python is widely used for experimentation, data processing and model integration. Java is common in enterprise services, transaction processing and large-scale integration. A practical architecture may use Python for a model-serving or data component and Java for an enterprise API, provided that contracts, deployment, observability and security are explicit. 6. Evaluating Emerging PracticesTechnology selection should be based on evidence. Useful evaluation dimensions include: | Dimension | Questions |
|---|
| Functional fit | Does the approach meet domain requirements? | | Reliability | What happens during dependency, network or model failure? | | Security | Are identities, secrets, data and interfaces protected? | | Cost | What are build, hosting, data-transfer and operational costs? | | Performance | Are latency, throughput and resource requirements acceptable? | | Maintainability | Can the team understand, test and change the system? | | Compliance | Are retention, audit, privacy and licensing obligations satisfied? | | Team capability | Can the organisation operate the technology sustainably? |
A prototype should measure realistic workloads rather than demonstrating only a successful example. For AI systems, evaluation should include both quality and safety. A response that is accurate but reveals confidential information is not acceptable. 7. Illustrative Case: A Student Support ServiceBackgroundA fictional college operates a student-support application. The existing Java monolith manages authentication, appointments and notifications. A Python service is being considered for classifying incoming support requests and suggesting relevant policy documents. ProblemThe team wants faster releases and automated assistance, but it has limited operations experience. Student messages may contain sensitive personal information. Incorrect advice could affect enrolment or financial support. AnalysisA complete migration to microservices would introduce service discovery, distributed tracing, deployment complexity and data-consistency risks. The team therefore identifies bounded capabilities rather than splitting every class into a service. Authentication and appointment transactions remain in the Java application. Classification is isolated behind a versioned API because it has different libraries and release needs. The proposed intelligent feature retrieves approved policy documents. It does not make final eligibility decisions. High-impact cases are routed to a trained staff member. The system records document versions and model versions for audit, while access controls prevent one student’s information from becoming retrieval context for another. ApproachThe team uses an incremental plan: - Define classification categories and unacceptable outputs.
- Build a Python prototype using anonymised data.
- Create an independent evaluation set, including ambiguous and adversarial messages.
- Expose a secured API with timeouts and a clear error response.
- Keep the Java application authoritative for appointments and student records.
- Add human review, audit logging and monitoring before production release.
- Conduct a limited pilot and compare outcomes with the existing process.
AI coding tools may draft API models and tests, but developers verify them against the service contract and security policy. OutcomeThe architecture improves experimentation without forcing a risky full migration. The pilot reduces routine classification effort, while uncertain cases remain under human control. The college discovers that retrieval quality and document governance matter more than simply selecting a larger model. Learning pointsThe case illustrates that emerging practices should solve a defined problem. Microservices are justified by boundaries and operational needs, not fashion. AI must be evaluated as part of a socio-technical process involving users, data, policies and accountability. 8. Java–Python DevelopmentsJava continues to develop as a strongly typed, enterprise-oriented language with modern language features, improved runtime performance and extensive tooling. Python continues to support rapid development, automation, scientific computing and AI. Interoperability is increasingly achieved through HTTP, messaging, containers, shared schemas and service contracts rather than by forcing both languages into one runtime. Important future-oriented practices include: - automated dependency updates with review and testing;
- type checking and quality tooling in Python;
- modern Java language and concurrency features where supported;
- containerised, reproducible builds;
- software supply-chain security and signed artefacts;
- policy-as-code in CI/CD pipelines;
- observability designed into services from the beginning;
- local and private AI models where data control is important;
- energy and cost awareness in model and cloud selection.
Future developers will need both implementation skills and evaluation skills. They must understand enough about models, distributed systems, security and governance to recognise when an apparently convenient solution creates unacceptable risk. 9. Ethical, Legal and Governance ResponsibilitiesResponsible development includes fairness, privacy, transparency, accountability and security. Relevant obligations vary by jurisdiction and sector, so developers should consult institutional policy and qualified legal or compliance professionals rather than relying on generic AI advice. Key controls include: - data minimisation and lawful handling of personal data;
- permission-aware access to training and retrieval data;
- disclosure when users interact with an automated system where appropriate;
- human oversight for consequential decisions;
- records of model, data and prompt changes;
- vulnerability management and incident response;
- review of third-party licence and usage conditions;
- protection against prompt injection, data exfiltration and insecure tool use.
An organisation should define who approves an AI feature, who monitors it, who responds to incidents and who can disable it. Governance is effective only when responsibilities are operationally assigned. Best-Practice ChecklistBefore accepting AI-assisted or emerging-architecture work, ask: - Is the requirement explicit and testable?
- Was confidential data protected during development?
- Has generated code been reviewed by a competent developer?
- Do tests include invalid, boundary and failure cases?
- Were official language and framework sources consulted?
- Are dependencies, licences and supply-chain risks understood?
- Are logs, metrics, traces and alerts sufficient for operation?
- Is there a rollback or disablement procedure?
- Are human responsibility and escalation paths clear?
- Does the architecture solve a real problem at an acceptable cost?
Chapter SummaryGenerative AI can assist Java and Python developers with coding, testing and documentation, but generated output is an unverified draft rather than an authority. Responsible use requires clear requirements, limited prompts, protection of sensitive information, independent tests, security review, human judgement and traceability. Monoliths, microservices, serverless computing and platform engineering represent different architectural trade-offs. Microservices and serverless approaches can improve independent scaling and delivery, but they also increase operational and distributed-system complexity. Platform engineering provides reusable, governed developer paths. Intelligent applications combine software, data, retrieval, models, validation and human oversight; their quality depends on the complete system, not only on model capability. Java and Python remain complementary. Successful future development will combine language expertise with cloud-native operations, AI literacy, software supply-chain security, observability and ethical governance. Key TermsGenerative AI: Artificial intelligence that produces new text, code, images or other content. Prompt: Instruction and contextual information supplied to an AI system. AI-assisted development: Software development in which AI supports, but does not replace, human engineering judgement. Verification: Evidence-based checking that an output satisfies functional, quality and governance requirements. Microservices: Independently deployable services organised around business capabilities. Monolith: An application delivered as one deployable unit. Serverless computing: A cloud model in which infrastructure provisioning and management are largely abstracted from developers. Cold start: Startup delay that may occur when a serverless function or service instance is created. Platform engineering: Creation of internal tools and workflows that provide reliable development and deployment paths. Observability: The ability to understand system behaviour through logs, metrics and traces. Intelligent application: An application that incorporates models or AI-enabled services into a broader software system. Retrieval-augmented generation: Generation supported by retrieving relevant external documents as model context. Prompt injection: An attempt to manipulate an AI system through crafted input or retrieved content. Human-in-the-loop: A design in which a person reviews, approves or corrects automated results. Idempotence: A property whereby repeating an operation produces the same intended effect as performing it once. Circuit breaker: A resilience mechanism that temporarily stops calls to a failing dependency. Software supply chain: The people, processes, tools and dependencies used to build and distribute software. Model drift: Change in model or data behaviour that reduces performance over time. Review QuestionsShort Answer Questions- Why is compilation insufficient for accepting AI-generated code?
- State two risks of entering confidential project information into an AI service.
- What is the main architectural purpose of a microservice boundary?
- Define serverless computing.
- What is retrieval-augmented generation?
Long Answer Questions- Explain a responsible workflow for using generative AI to create and integrate a Java or Python feature.
- Compare monolithic and microservices architectures, including benefits, costs and suitable contexts.
- Discuss the operational advantages and limitations of serverless computing.
- Explain how platform engineering can improve developer productivity without hiding operational responsibility.
- Describe the technical and ethical controls required for an intelligent student-support application.
Analytical / Application Questions- A small team proposes splitting a stable monolith into twelve microservices before it has automated deployment or centralised monitoring. Evaluate the proposal and recommend a responsible sequence of actions.
- An AI-generated Python function passes its supplied tests but exposes personal data in error messages. Explain why the output must be rejected and design additional verification controls.
- A Java transaction service must call a Python classification service that may be unavailable. Design a resilient interaction covering timeout, retry, fallback, observability and human escalation.
Multiple Choice Questions with AnswersQuestion 1Which statement best describes responsible use of generative AI in programming? A. Accepting output whenever it compiles B. Using AI output as a draft subject to human verification C. Allowing AI to make all production decisions D. Replacing tests with AI explanations Correct Answer: B. Using AI output as a draft subject to human verification Question 2Which activity provides evidence that generated code satisfies requirements? A. Checking whether the response sounds confident B. Renaming the generated variables C. Running independent tests including boundary and failure cases D. Increasing the prompt length only Correct Answer: C. Running independent tests including boundary and failure cases Question 3A major cost of microservices is: A. The inability to deploy services independently B. Distributed-system and operational complexity C. The requirement that all services use Python D. The elimination of network failures Correct Answer: B. Distributed-system and operational complexity Question 4In serverless computing, the provider generally manages: A. All business requirements B. The correctness of application logic C. Much of the underlying infrastructure provisioning D. The organisation’s legal responsibilities Correct Answer: C. Much of the underlying infrastructure provisioning Question 5What is the main purpose of platform engineering? A. To remove all choices from developers B. To provide reusable and governed development paths C. To prevent the use of automated testing D. To replace application architecture Correct Answer: B. To provide reusable and governed development paths Question 6Which feature is central to a responsible intelligent application? A. Unrestricted access to all organisational data B. Human oversight for high-impact decisions C. No logging under any circumstances D. Acceptance of every model response Correct Answer: B. Human oversight for high-impact decisions Question 7Retrieval-augmented generation combines a language model with: A. Relevant retrieved documents or knowledge B. Only manually typed responses C. A compiler optimisation pass D. A database transaction rollback Correct Answer: A. Relevant retrieved documents or knowledge Question 8Why can retrying a payment request be dangerous? A. Retries always reduce availability B. A non-idempotent operation may create a duplicate payment C. Retries remove authentication D. Payment requests cannot use networks Correct Answer: B. A non-idempotent operation may create a duplicate payment Question 9Which combination is most appropriate for operational understanding of a distributed system? A. Logs, metrics and traces B. Comments only C. A larger source file D. A single screenshot Correct Answer: A. Logs, metrics and traces Question 10Which statement about Java and Python is most accurate? A. One language must replace the other in every architecture B. They can be combined through explicit APIs, messaging and contracts C. They cannot participate in the same system D. Python is suitable only for documentation Correct Answer: B. They can be combined through explicit APIs, messaging and contracts
|