AI tools are being trialled in many areas including software development, with examples such as GitHub Copilot, CodePal, SourceAI and Tabnine. In this post, I will look at the impact of these tools on coding and use that to predict how they will impact the design of software architecture.
AI 工具正在包括软件开发在内的许多领域进行试验,例如 GitHub Copilot、CodePal、SourceAI 和 Tabnine。在这篇文章中,我将研究这些工具对编码的影响,并使用它来预测它们将如何影响软件架构的设计。
Predictions around this are very hard to make, especially taking into account how fast this field is changing, so it will be interesting to revisit this blog in a couple of years to see how things are. But taking those caveats into account, I am going to argue that software architecture may change to being more data-driven, with prototype architectures and architectural diagrams being generated from the actual code itself.
围绕这一点做出预测非常困难,尤其是考虑到这个领域的变化速度有多快,因此几年后重新访问这个博客以了解情况会很有趣。但考虑到这些注意事项,我将论证软件架构可能会转变为更加数据驱动的架构,原型架构和架构图是从实际代码本身生成的。
How AI is already speeding up coding
AI 如何加快编码速度
Looking at coding, we can see four clear examples of how coding can be sped up using AI tools that are available now.
看看编码,我们可以看到四个清晰的示例,说明如何使用现在可用的 AI 工具加速编码。
The first is advanced code completion. This is where the AI can complete code quickly and with increasing ease, doing a lot more than the previous generation which statistically predicted the completion of the code. This is especially the case with common tasks that it has seen before, putting the old code completion systems on steroids.
首先是高级代码完成。这就是 AI 可以快速、轻松地完成代码的地方,比上一代产品做得更多,上一代产品在统计上预测了代码的完成情况。对于以前见过的常见任务来说尤其如此,它使旧的代码完成系统陷入困境。
The second is code generation from plain text descriptions. Rapid UI prototyping tools such as Galileo AI can be used to generate UI screens based on plain text descriptions of what they need to do. CodePal and GitHub Copilot can generate code in many different languages based on a plain text description. Developers are in the process of finding out how capable and useful these tools can be, but many are already predicting that they will turbocharge software development once the tools mature.
第二种是从纯文本描述生成代码。Galileo AI 等快速 UI 原型设计工具可用于根据他们需要执行的操作的纯文本描述生成 UI 屏幕。CodePal 和 GitHub Copilot 可以根据纯文本描述生成许多不同语言的代码。开发人员正在了解这些工具的功能和有用性,但许多人已经预测,一旦这些工具成熟,他们将加速软件开发。
The third is finding and fixing bugs. These tools could be used to help experienced software engineers to find bugs (such as security loopholes or mistakes in logic), as discussed in this TechRadar article, or could even be used as an interactive way for people to learn how to code.
第三个是查找和修复 bug。这些工具可用于帮助经验丰富的软件工程师发现错误(例如安全漏洞或逻辑错误),如本 TechRadar 文章中所述,甚至可以用作人们学习如何编码的交互式方式。
The fourth is reading code and summarising it using natural language. This could help with code maintenance. As well as helping experienced developers cross-train from one language to another, these tools could be akin to a personal interactive teacher in helping people learn to code from scratch; although this is easier with simple examples, the tools are highly likely to improve over time.
第四个是读取代码并使用自然语言进行总结。这可能有助于代码维护。除了帮助经验丰富的开发人员从一种语言交叉训练到另一种语言之外,这些工具还可以类似于个人互动老师,帮助人们从头开始学习编码;尽管使用简单的示例更容易做到这一点,但这些工具很可能会随着时间的推移而改进。
Code generation is improving all the time, as Martin Heller discusses in this Infoworld article. While early code generators weren’t generating code that was correct, or even compiled, they are now starting to be able to generate code that can compile, along with Unit Tests that can work. However, just like ChatGPT, the tools can confidently give an answer even when they’re wrong.
正如 Martin Heller 在这篇 Infoworld 文章中所讨论的那样,代码生成一直在改进。虽然早期的代码生成器无法生成正确的代码,甚至无法编译的代码,但它们现在开始能够生成可编译的代码以及可工作的单元测试。然而,就像 ChatGPT 一样,这些工具即使出错也可以自信地给出答案。
So, we have seen that coding can be turbocharged in producing, reading and maintaining code, and helping developers get up to speed on languages quickly. But what can these new capabilities do to help with the design of software architecture?
因此,我们已经看到,编码可以在生成、读取和维护代码方面发挥重要作用,并帮助开发人员快速掌握语言。但是,这些新功能可以做些什么来帮助设计软件架构呢?
How software architecture is designed today
当今的软件架构是如何设计的
It could be argued that those who are great at designing software architecture today use a bit of science and a bit of creativity. Ultimately, the architect’s role is to simplify what is going on, or what will go on, at the software level, and to abstract it to the point where decisions can be made about it. The challenge for many is to document the rest of the architecture that the system or component has to work within to understand how the components and systems interact. This is often done by talking to individuals and examining code, but is subject to a certain amount of approximation, guesswork and simplification. Ultimately, it is an error-prone process where experienced heads are often required to help navigate and make good decisions.
可以说,今天那些擅长设计软件架构的人使用了一点科学和一点创造力。归根结底,架构师的角色是在软件级别简化正在发生的事情或将要发生的事情,并将其抽象到可以做出决策的程度。许多人面临的挑战是记录系统或组件必须在其中工作的架构的其余部分,以了解组件和系统如何交互。这通常是通过与个人交谈和检查代码来完成的,但需要经过一定程度的近似、猜测和简化。归根结底,这是一个容易出错的过程,通常需要经验丰富的负责人来帮助导航并做出正确的决策。
But imagine if software architecture was designed and reviewed with more information; if runnable prototypes of the backends could be built with button clicks in seconds to try out architectures; if the logs of the architecture could be reviewed and performance issues spotted, with remedies recommended (as mentioned by the BCS). It is also noted within that BCS post that there’s the potential to apply “AI to the design stage to provide a higher level of direct input when considering the pros and cons of architectural options.” In the rest of this blog post, I wish to consider the viability of this and its potential impact on how software architecture is designed.
但是想象一下,如果软件架构的设计和审查提供了更多信息;如果可以在几秒钟内通过单击按钮来构建后端的可运行原型以尝试架构;如果可以查看架构的日志并发现性能问题,并推荐补救措施(如 BCS 所述)。BCS 帖子中还指出,有可能将“AI 应用于设计阶段,以便在考虑架构选项的优缺点时提供更高级别的直接输入”。在这篇博文的其余部分,我希望考虑一下这种方法的可行性及其对软件架构设计方式的潜在影响。
So, how is AI likely to impact how software architecture decisions are made?
那么,AI 可能会如何影响软件架构决策的制定方式呢?
Clickable mockups have improved and accelerated UI design by speeding up the iterative process of presenting a mockup, getting feedback on it and modifying it – all now fast enough to do within days. It tends not to be possible to do such short iterations to test architecture because changes normally require significant work in the backend.
可点击模型通过加快呈现模型、获得反馈和修改模型的迭代过程,改进和加速了 UI 设计 - 现在所有这些都足够快,可以在几天内完成。往往不可能进行如此短的迭代来测试架构,因为更改通常需要在后端进行大量工作。
This means that most software architecture design is an art as much as a science, as experienced heads make their best guestimate based on what they do know or can know easily. An AI agent which reviews the actual code, log files etc. could provide a huge amount of extra information and even test different performance or load scenarios.
这意味着大多数软件架构设计既是一门科学,也是一门艺术,因为有经验的人会根据他们所知道或可以轻松了解的内容来做出最好的估计。审查实际代码、日志文件等的 AI 代理可以提供大量额外信息,甚至可以测试不同的性能或负载场景。
Earlier non-AI platforms that are designed to support the rapid connecting of systems, such as Mulesoft Anypoint, can reduce the amount of boilerplate code; that said, it still typically takes weeks to produce components which connect to multiple systems. This generation of tools was never fast enough to turn integration into point-and-click real-time.
早期旨在支持系统快速连接的非 AI 平台(例如 Mulesoft Anypoint)可以减少样板代码的数量;也就是说,生产连接到多个系统的组件通常需要数周时间。这一代工具的速度从来都不够快,无法将集成转变为实时点击式。
Newer integration platforms such as Cyclr and Boomi are going down the low-code, point-and-click route to reduce integration time further. In fact, Boomi has introduced an AI component which uses anonymised learnings from lots of previous integrations achieved with the Boomi platform to automagically create mappings between two integration points, often the most time-consuming part of an integration.
Cyclr 和 Boomi 等较新的集成平台正在采用低代码、点击式路线,以进一步缩短集成时间。事实上,Boomi 已经引入了一个 AI 组件,该组件使用从之前与 Boomi 平台实现的许多集成中获得的匿名学习成果,自动创建两个集成点之间的映射,这通常是集成中最耗时的部分。
Four predictions 四个预测
So, assuming AI-supported development will continue to get easier, more accurate and more common, what are the implications for software architecture? I will argue that there will be four potentially large changes to how software architecture is designed.
那么,假设 AI 支持的开发将继续变得更简单、更准确和更普遍,这对软件架构有什么影响呢?我将论证软件架构的设计方式将有四个潜在的重大变化。
1) Trade-offs will be tested instead of theorised
1) 权衡取舍将经过检验,而不是理论化
With the current AI code-generation systems, we have seen that code can be generated very quickly which very much looks the part, even if it isn’t entirely accurate all of the time. As long as the code compiles, potentially this is good enough for prototype integration. Allowing systems to be connected super-quickly, if not perfectly, enables tests to be run that connect the systems in different ways and therefore test different architectures.
在当前的 AI 代码生成系统中,我们已经看到代码可以非常快速地生成,即使它并不总是完全准确,这看起来非常关键。只要代码能够编译,这可能就足以进行原型集成。允许系统以超快的速度连接(如果不是完美的)可以运行以不同方式连接系统的测试,从而测试不同的架构。
This good-enough code generation for backend/architecture prototyping could allow architects not just to guess what the best architecture for a new system or component in a current system might be, but actually to generate alternative architectures and test out trade-offs. This process is not currently done at the prototyping stage, but instead during the dry design of the system or, if you are lucky, during sprints in order to iron out the creases in architecturally significant stories. It will enable trade-offs on speed, latency and throughput, providing guarantees that are usually made without hard data.
这种用于后端/架构原型设计的足够好的代码生成不仅可以让架构师猜测当前系统中新系统或组件的最佳架构可能是什么,而且实际上可以生成替代架构并测试权衡。这个过程目前不是在原型设计阶段完成的,而是在系统的枯燥设计期间完成,或者,如果你幸运的话,在 sprint 期间完成,以便消除具有建筑意义的故事中的折痕。它将支持在速度、延迟和吞吐量之间进行权衡,提供通常无需硬数据的保证。
At present, these tests may be limited by the availability of test versions of all the systems that a new system or component would have to work within (often an organisational challenge, rather than a technical one). However, it is possible to imagine AI technologies mocking up test versions of those missing systems or components.
目前,这些测试可能会受到新系统或组件必须在其中工作的所有系统的测试版本可用性的限制(通常是组织挑战,而不是技术挑战)。但是,可以想象 AI 技术模拟那些缺失的系统或组件的测试版本。
2) Designing software architecture will be more data-driven, likely by system prototyping
2) 设计软件架构将更多地由数据驱动,可能由系统原型设计驱动
If these trade-offs can be tested, the tasks of Software Architects and Solution Architects could morph into those of a System Prototyper. Instead of having to argue for a certain architecture, they could try stuff out, record tests and gather real-world evidence for the design decisions and then document them for the developers.
如果这些权衡可以被测试,软件架构师和解决方案架构师的任务就可以演变成系统原型设计师的任务。他们不必为某个架构争论,而是可以尝试一些东西,记录测试并为设计决策收集真实世界的证据,然后为开发人员记录它们。
While existing software architecture expertise and experience will be super-valuable in this new role, more classic Developer-type skills will also be required in order to get these system prototypes working and try stuff out. Only time will tell whether this will mean that Software Architects will do system prototyping, or whether Developers will take on this role and push them into a space where they are making architecture decisions. Either way, AI will likely help make decisions around architecture more data-driven compared to current practice.
虽然现有的软件架构专业知识和经验在这个新角色中非常有价值,但还需要更经典的开发人员类型技能,以便让这些系统原型工作并尝试一些东西。只有时间才能证明这是否意味着软件架构师将进行系统原型设计,或者开发人员是否会承担这个角色并将他们推入他们做出架构决策的领域。无论哪种方式,与当前做法相比,AI 都可能有助于围绕架构做出更加数据驱动的决策。
3) It will enable more complex architectures with more nuanced trade-offs
3) 它将支持更复杂的架构和更细微的权衡
Being able to prototype and compare different architectures quickly will allow more nuanced decisions to be made – whether approach A or approach B should be used, or whether a database should be Eventual Consistency or Fully Consistent. Databases and messaging middleware have tended to become more configurable around guarantees over the last decade or so, allowing the designer to choose trade-offs with more certainty as they can try the trade-offs out. If Software Architects can quickly try out the implication of their trade-offs instead of just guessing them, it means that the more nuanced decisions can be made with confidence and these highly configurable middleware components can be utilised more fully.
能够快速构建原型并比较不同的架构将允许做出更细致的决策 - 是使用方法 A 还是方法 B,或者数据库应该是最终一致性还是完全一致。在过去十年左右的时间里,数据库和消息传递中间件在保证方面往往变得更加可配置,这使得设计人员可以更确定地选择权衡,因为他们可以尝试权衡。如果软件架构师能够快速尝试他们的权衡的含义,而不仅仅是猜测它们,这意味着可以自信地做出更细微的决策,并且可以更充分地利用这些高度可配置的中间件组件。
Open source components such as Open Messaging benchmarking tools for comparing middleware are starting to appear (currently Apache RocketMQ, Kafka, Pulsar, RabbitMQ, NATS streaming, REDIS and Pravega).
开源组件,如用于比较中间件的 Open Messaging 基准测试工具开始出现(目前是 Apache RocketMQ、Kafka、Pulsar、RabbitMQ、NATS streaming、REDIS 和 Pravega)。
In theory, this should help the architecture and system to be more sustainable going forward – because decisions around trade-offs can include chargeability, storage, data moving etc, which can all impact the environment. It is perfectly conceivable that AI tools will be generated that could create a score for architectural simplicity and maintainability, making the process of decision-making around trade-offs more a matter of reviewing data than they are currently.
从理论上讲,这应该有助于架构和系统在未来更具可持续性——因为围绕权衡的决策可能包括可计费性、存储、数据移动等,这些都会影响环境。完全可以想象,将生成 AI 工具,这些工具可以为架构简单性和可维护性打分,使围绕权衡的决策过程比目前更像是审查数据。
4) AI tools will be able to provide more information on software architecture, generating useful diagrams from code or vice versa
4) AI 工具将能够提供有关软件架构的更多信息,从代码生成有用的图表,反之亦然
As mentioned previously, it is commonly a very manual process for an Architect to gain an understanding of the components and architecture within which a system or component has to work. A huge step-up would be a tool that could look at the code, systems and APIs, and generate knowledge of a current system which could then easily be interrogated by a Software Architect – transforming part of the architectural design process that is currently very manual, time-consuming and error-prone.
如前所述,架构师通常是一个非常手动的过程,以了解系统或组件必须在其中工作的组件和架构。一个巨大的进步将是一个工具,它可以查看代码、系统和 API,并生成当前系统的知识,然后软件架构师可以很容易地询问这些知识——改变了目前非常手动、耗时且容易出错的架构设计过程的一部分。
As things stand, architecture diagrams tend to be hand-crafted, produced by experienced Architects who add value by deciding what to display and what to compare in order to aid communication of the architecture and any proposed changes. This process is incredibly manual. While there has been an evolution in terms of having diagrams driven by code to describe the diagrams, they still have no real connection to the code itself. (There have also been waves of tools to generate diagrams from actual code, and vice versa, but they tended to have limited use due to two key issues: (1) diagrams generated from code tend to be too complex to be useful – they tend to need to be simplified to show architecturally significant details only; and (2) a similar issue applies to code generated from diagrams – it is too simplistic to run without being enhanced. These two issues mean that once the code is generated from the diagram or vice versa, the two tend to drift apart so that the code evolves without the diagram being updated and vice versa).
就目前的情况而言,架构图往往是手工制作的,由经验丰富的架构师制作,他们通过决定显示什么和比较什么来增加价值,以帮助沟通架构和任何提议的更改。这个过程非常手动。虽然在让代码驱动的图表来描述图表方面已经发生了变化,但它们仍然与代码本身没有真正的联系。(也有一波从实际代码生成图表的工具,反之亦然,但由于两个关键问题,它们的使用往往受到限制:(1) 从代码生成的图表往往太复杂而无法使用 – 它们往往需要简化以仅显示具有架构意义的细节;(2) 类似的问题适用于从图表生成的代码 – 它太简单了,无法在不增强的情况下运行。这两个问题意味着,一旦代码是从图表生成的,或者反之亦然,两者往往会偏离,因此代码在没有更新图表的情况下发展,反之亦然。
AI could completely change this by learning what is useful from the code and from existing pools of architecture diagrams, and then trawling the code of other systems, to produce diagrams showing the current interconnectivity of systems and an understanding of the current architecture. This could include showing whether systems are tightly coupled instead of loosely coupled, or whether microservices are too granular resulting in a system that’s a spaghetti set of calls between microservices to carry out simple tasks.
AI 可以通过从代码和现有的架构图池中学习有用的内容,然后搜索其他系统的代码,以生成显示当前系统互连和对当前架构的理解的图表,从而完全改变这种情况。这可能包括显示系统是否紧密耦合而不是松散耦合,或者微服务是否过于精细,导致系统成为微服务之间的一组意大利面条式调用来执行简单任务。
So, what might the impact be?
那么,可能产生什么影响呢?
Tools like Copilot are likely to change Developers’ ways of working rapidly and significantly. In the same way, if AI can enable super-fast, semi-working, quick-and-dirty backend integrations of components and systems, the software architecture design could evolve swiftly – from a role that is about diagrams and summarising into a role which is more about coding prototypes to try stuff out. The implications of this will come out in time, but I suspect it will enable us to make more nuanced architectural trade-offs, and make more comprehensive use of the highly configurable middleware, databases, and messaging platforms that have grown up over the last decade.
像 Copilot 这样的工具可能会迅速而显着地改变开发人员的工作方式。同样,如果 AI 能够实现组件和系统的超快速、半工作、快速和肮脏的后端集成,那么软件架构设计就可以迅速发展——从一个关于图表和总结的角色转变为一个更多的关于编码原型以尝试的角色。其影响会及时显现出来,但我怀疑它将使我们能够进行更细致的架构权衡,并更全面地利用过去十年中发展起来的高度可配置的中间件、数据库和消息传递平台。
It could also have an impact on who makes architectural decisions if suddenly Developers have tools allowing them to try out architectural decisions themselves. One of my colleagues compared making architectural decisions with controlling the chaos. With the potential for Developers to make more of the architectural decisions themselves, time will tell whether that chaos will be reined in more or less, and whether that will be a good thing or bad. (Excel is a great example of this, where it’s such a powerful tool that it’s often ended up becoming a way for business people to develop business systems outside of the controls within the IT department. Many businesses have benefited hugely from this, but many in the IT organisations would argue this uncontrolled ability to create or enhance systems has come at a high price – for instance, see this Society of Actuaries article).
如果突然间开发人员拥有允许他们自己尝试架构决策的工具,它还可能对谁做出架构决策产生影响。我的一位同事将制定架构决策与控制混乱进行了比较。由于开发人员有可能自己做出更多的架构决策,时间会证明这种混乱是否会得到或多或少的控制,以及这是好事还是坏事。(Excel 就是一个很好的例子,它是一个非常强大的工具,它通常最终成为业务人员在 IT 部门内部的控制之外开发业务系统的一种方式。许多企业从中受益匪浅,但 IT 组织中的许多人会争辩说,这种不受控制地创建或增强系统的能力付出了高昂的代价——例如,请参阅精算师协会的这篇文章)。
I’ll finish with a couple of questions I’d love to know the answer to, given my interest in personality theories and attributes: if AI tools enable software architecture to become more like prototyping, with AI support to integrate quickly, will it change the nature of the Software Architect role enough to draw in people with different personality characteristics that haven’t been so enticed into architecture previously? And how will that impact the profession and software development overall?
鉴于我对人格理论和特质的兴趣,我将以几个我很想知道答案的问题结束:如果 AI 工具使软件架构变得更像原型设计,并在 AI 支持下快速集成,它是否会改变软件架构师角色的性质,从而吸引具有不同性格特征的人,而这些人以前没有那么喜欢建筑?这将如何影响整个专业和软件开发?
Watch this space; I certainly will.
关注这个空间;我当然会。
Download our white paper 下载我们的白皮书
We’ve recently published a white paper on de-risking generative AI in highly regulated environments – you can download the white paper here. And you can visit our page on how to Harness the potential of AI for more of our thinking in this area.
我们最近发布了一份关于在高度监管环境中降低生成式 AI 风险的白皮书 – 您可以在此处下载白皮书。您可以访问我们的页面,了解如何利用 AI 的潜力来更多地思考这一领域。