小架构step系列14:白盒集成测试原理

MATLAB组合系统建模:从耦合逻辑到多物理域协同 组合系统建模是控制系统、电力电子与多物理场仿真中的核心能力,其本质在于处理子系统间的能量与信息耦合关系。不同于单模块仿真,组合建模需深入理解微分代数方程(DAE)、接口契约与求解器适配等底层原理,技术价值体现在提升模型精度、保障数值稳定性及支撑数字孪生落地。典型应用场景包括电机-逆变器联合仿真、电池热-电耦合分析、双伺服协同控制等工业级系统。本文聚焦MATLAB平台下真实工程中高频出现的耦合失配、代数环、采样率冲突与Simscape物理建模等关键问题,结合ode15s、Simscape、模块化接口协议等实战 阅读详情

1 概述

这里的白盒测试是指开发编写测试代码来进行测试,集成测试是指从Controller开始对http接口调用的整个流程进行测试。这个流程就是对一个http请求的响应流程,正常运行的时候是通过springboot内嵌的tomcat来启动一个web server来监听http请求,然后响应该http请求。在测试的时候,如果也需要启动一个web server来监听请求,那么测试就更加困难了一些。还好spring-test为这个场景提供了便利,本文来了解一下它们的原理。

2 原理

2.1 测试例子

下面是针对Controller里的sayHello接口进行的测试:

// HelloController.java
@RestController
public class HelloController {
    private Logger logger = LoggerFactory.getLogger(HelloController.class);
    @RequestMapping("sayHello")
    public String say(@RequestParam("message") String messge) {
        return "Hello world: " + messge;
    }
}

// HelloControllerTest.java
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.http.MediaType;
import org.springframework.test.web.servlet.MockMvc;
import org.springframework.test.web.servlet.MvcResult;
import org.springframework.test.web.servlet.request.MockMvcRequestBuilders;
import static org.assertj.core.api.Assertions.assertThat;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;

@SpringBootTest
@AutoConfigureMockMvc
public class HelloControllerTest {
    @Autowired
    private MockMvc mockMvc;

    @Test
    public void should_say_string() throws Exception {
        String messge = "abc";
        MvcResult result = mockMvc.perform(MockMvcRequestBuilders.post("/sayHello")
                .contentType(MediaType.APPLICATION_FORM_URLENCODED)
                .content("message=" + messge))
                .andExpect(status().isOk())
                .andReturn();
        assertThat(result.getResponse().getContentAsString()).isEqualTo("Hello world: " + messge);
    }
}

2.2 http请求流程

正常的http请求流程是:springboot启动进行初始化,把关键的DispatcherServlet和Tomcat server初始化,把DispatcherServlet设置到Tomcat server中,由Tomcat server监听到http请求,然后在worker线程中由DispatcherServlet处理请求,最终调到Controller的接口执行业务逻辑。

// 1. 在自动配置的时候,DispatcherServlet成为一个bean,注入到DispatcherServletRegistrationBean中,再通过DispatcherServletRegistrationBean设置到tomcat中
// 源码位置:org.springframework.boot.autoconfigure.web.servlet.DispatcherServletAutoConfiguration.DispatcherServletRegistrationConfiguration
@Configuration(proxyBeanMethods = false)
@Conditional(DispatcherServletRegistrationCondition.class)
@ConditionalOnClass(ServletRegistration.class)
@EnableConfigurationProperties(WebMvcProperties.class)
@Import(DispatcherServletConfiguration.class)
protected static class DispatcherServletRegistrationConfiguration {
    @Bean(name = DEFAULT_DISPATCHER_SERVLET_REGISTRATION_BEAN_NAME)
    @ConditionalOnBean(value = DispatcherServlet.class, name = DEFAULT_DISPATCHER_SERVLET_BEAN_NAME)
    public DispatcherServletRegistrationBean dispatcherServletRegistration(DispatcherServlet dispatcherServlet, WebMvcProperties webMvcProperties, ObjectProvider<MultipartConfigElement> multipartConfig) {
        // 2. DispatcherServletRegistrationBean实现了org.springframework.boot.web.servlet.ServletContextInitializer接口,
        //    后面会通过这个接口类型来获取此bean
        DispatcherServletRegistrationBean registration = new DispatcherServletRegistrationBean(dispatcherServlet, webMvcProperties.getServlet().getPath());
        registration.setName(DEFAULT_DISPATCHER_SERVLET_BEAN_NAME);
        registration.setLoadOnStartup(webMvcProperties.getServlet().getLoadOnStartup());
        multipartConfig.ifAvailable(registration::setMultipartConfig);
        return registration;
    }
    // 省略其它代码
}
// 源码位置:org.springframework.boot.autoconfigure.web.servlet.DispatcherServletAutoConfiguration
@Configuration(proxyBeanMethods = false)
@Conditional(DefaultDispatcherServletCondition.class)
@ConditionalOnClass(ServletRegistration.class)
@EnableConfigurationProperties(WebMvcProperties.class)
protected static class DispatcherServletConfiguration {
    @Bean(name = DEFAULT_DISPATCHER_SERVLET_BEAN_NAME)
    public DispatcherServlet dispatcherServlet(WebMvcProperties webMvcProperties) {
        // 3. 初始化org.springframework.web.servlet.DispatcherServlet为一个bean
        DispatcherServlet dispatcherServlet = new DispatcherServlet();
        dispatcherServlet.setDispatchOptionsRequest(webMvcProperties.isDispatchOptionsRequest());
        dispatcherServlet.setDispatchTraceRequest(webMvcProperties.isDispatchTraceRequest());
        dispatcherServlet.setThrowExceptionIfNoHandlerFound(webMvcProperties.isThrowExceptionIfNoHandlerFound());
        dispatcherServlet.setPublishEvents(webMvcProperties.isPublishRequestHandledEvents());
        dispatcherServlet.setEnableLoggingRequestDetails(webMvcProperties.isLogRequestDetails());
        return dispatcherServlet;
    }
    // 省略其它代码
}


// 4. Springboot启动的时候,会初始化ServletWebServerApplicationContext
// 源码位置:org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext
private org.springframework.boot.web.servlet.ServletContextInitializer getSelfInitializer() {
    return this::selfInitialize;
}
private void selfInitialize(ServletContext servletContext) throws ServletException {
    prepareWebApplicationContext(servletContext); // servletContext为ApplicationContextFacade
    registerApplicationScope(servletContext);
    WebApplicationContextUtils.registerEnvironmentBeans(getBeanFactory(), servletContext);
    // 5. getServletContextInitializerBeans()获取实现了ServletContextInitializer接口的bean,以获得里面的dispatcherServlet
    for (ServletContextInitializer beans : getServletContextInitializerBeans()) {
        // 6. 会调用ApplicationContextFacade的addServlet()把dispatcherServlet设置到tomcat中
        beans.onStartup(servletContext); 
    }
}
protected Collection<ServletContextInitializer> getServletContextInitializerBeans() {
    return new ServletContextInitializerBeans(getBeanFactory());
}
// 源码位置:org.springframework.boot.web.servlet.ServletContextInitializerBeans
public ServletContextInitializerBeans(ListableBeanFactory beanFactory, Class<? extends ServletContextInitializer>... initializerTypes) {
    this.initializers = new LinkedMultiValueMap<>();
    this.initializerTypes = (initializerTypes.length != 0) ? Arrays.asList(initializerTypes) : Collections.singletonList(ServletContextInitializer.class);
    addServletContextInitializerBeans(beanFactory);
    // 省略其它代码
}
private void addServletContextInitializerBeans(ListableBeanFactory beanFactory) {
    for (Class<? extends ServletContextInitializer> initializerType : this.initializerTypes) {
        // 7. initializerType=org.springframework.boot.web.servlet.ServletContextInitializer
        // DispatcherServletRegistrationBean实现了ServletContextInitializer接口,根据该接口类型获取到此bean,
        // 目的是获取里面的dispatcherServlet,存到ServletContextInitializerBeans中
        for (Entry<String, ? extends ServletContextInitializer> initializerBean : getOrderedBeansOfType(beanFactory, initializerType)) {
            // key=dispatcherServletRegistration,value=dispatcherServlet
            addServletContextInitializerBean(initializerBean.getKey(), initializerBean.getValue(), beanFactory);
        }
    }
}
// 源码位置:org.apache.catalina.core.ApplicationContextFacade
public ServletRegistration.Dynamic addServlet(String servletName, Servlet servlet) {
    if (SecurityUtil.isPackageProtectionEnabled()) {
        return (ServletRegistration.Dynamic) doPrivileged("addServlet", new Class[] { String.class, Servlet.class },
                new Object[] { servletName, servlet });
    } else {
        // 8. context为tomcat里的org.apache.catalina.core.ApplicationContext
        // 即把dispatcherServlet塞到了tomcat里执行
        return context.addServlet(servletName, servlet);
    }
}

// 9. 在发起http请求的时候,tomcat会创建ApplicationFilterChain
// 源码位置:org.apache.catalina.core.ApplicationFilterFactory(tomcat-embed-core包)
public static ApplicationFilterChain createFilterChain(ServletRequest request, Wrapper wrapper, Servlet servlet) {

    // If there is no servlet to execute, return null
    if (servlet == null) {
        return null;
    }

    // Create and initialize a filter chain object
    ApplicationFilterChain filterChain = null;
    if (request instanceof Request) {
        Request req = (Request) request;
        if (Globals.IS_SECURITY_ENABLED) {
            // Security: Do not recycle
            filterChain = new ApplicationFilterChain();
        } else {
            filterChain = (ApplicationFilterChain) req.getFilterChain();
            if (filterChain == null) {
                filterChain = new ApplicationFilterChain();
                req.setFilterChain(filterChain);
            }
        }
    } else {
        // Request dispatcher in use
        // 10. 创建ApplicationFilterChain(实现javax.servlet.FilterChain接口)
        filterChain = new ApplicationFilterChain();
    }

    // 11. 把dispatcherServlet设置到ApplicationFilterChain中
    filterChain.setServlet(servlet);
    filterChain.setServletSupportsAsync(wrapper.isAsyncSupported());

    // 省略其它代码

    // Return the completed filter chain
    return filterChain;
}


// 12. tomcat启动worker线程执行ApplicationFilterChain的service方法
// 源码位置:org.apache.catalina.core.ApplicationFilterChain(tomcat-embed-core包)
public void doFilter(ServletRequest request, ServletResponse response) throws IOException, ServletException {
    if (Globals.IS_SECURITY_ENABLED) {
        final ServletRequest req = request;
        final ServletResponse res = response;
        try {
            java.security.AccessController.doPrivileged((java.security.PrivilegedExceptionAction<Void>) () -> {
                internalDoFilter(req, res);
                return null;
            });
        } catch (PrivilegedActionException pe) {
            Exception e = pe.getException();
            if (e instanceof ServletException) {
                throw (ServletException) e;
            } else if (e instanceof IOException) {
                throw (IOException) e;
            } else if (e instanceof RuntimeException) {
                throw (RuntimeException) e;
            } else {
                throw new ServletException(e.getMessage(), e);
            }
        }
    } else {
        // 13. 调用internalDoFilter()执行过滤器
        internalDoFilter(request, response);
    }
}
private void internalDoFilter(ServletRequest request, ServletResponse response) throws IOException, ServletException {
    // 省略其它代码
    try {
        if (ApplicationDispatcher.WRAP_SAME_OBJECT) {
            lastServicedRequest.set(request);
            lastServicedResponse.set(response);
        }

        if (request.isAsyncSupported() && !servletSupportsAsync) {
            request.setAttribute(Globals.ASYNC_SUPPORTED_ATTR, Boolean.FALSE);
        }
        // Use potentially wrapped request from this point
        if ((request instanceof HttpServletRequest) && (response instanceof HttpServletResponse) &&
                Globals.IS_SECURITY_ENABLED) {
            final ServletRequest req = request;
            final ServletResponse res = response;
            Principal principal = ((HttpServletRequest) req).getUserPrincipal();
            Object[] args = new Object[] { req, res };
            SecurityUtil.doAsPrivilege("service", servlet, classTypeUsedInService, args, principal);
        } else {
            // 14. 此servlet为dispatcherServlet,执行dispatcherServlet的service()
            servlet.service(request, response);
        }
    } catch (IOException | ServletException | RuntimeException e) {
        throw e;
    } catch (Throwable e) {
        e = ExceptionUtils.unwrapInvocationTargetException(e);
        ExceptionUtils.handleThrowable(e);
        throw new ServletException(sm.getString("filterChain.servlet"), e);
    } finally {
        if (ApplicationDispatcher.WRAP_SAME_OBJECT) {
            lastServicedRequest.set(null);
            lastServicedResponse.set(null);
        }
    }
}

2.3 测试流程

在执行测试用例的时候,从DispatcherServlet中扩展出一个TestDispatcherServlet,放到一个mock的MockMvc对象中;在执行具体测试用例时,调MockMvc的perform()方法来模拟发http请求,该请求没有tomcat server来接收,而是封装到一个mock请求中,用一个MockFilterChain来模仿filter链执行,最终执行到DispatcherServlet的service()方法,给予一个mock的响应。

// 1. 初始化的时候,创建个MockMvc类型的bean,里面包含着TestDispatcherServlet对象,TestDispatcherServlet继承于DispatcherServlet
// 源码位置:org.springframework.boot.test.autoconfigure.web.servlet.MockMvcAutoConfiguration
@Bean
@ConditionalOnMissingBean
public MockMvc mockMvc(MockMvcBuilder builder) {
    // 2. 用builder去创建MockMvc
    return builder.build();
}
// 源码位置:org.springframework.test.web.servlet.setup.AbstractMockMvcBuilder
public final MockMvc build() {
    WebApplicationContext wac = initWebAppContext();
    ServletContext servletContext = wac.getServletContext();
    MockServletConfig mockServletConfig = new MockServletConfig(servletContext);

    for (MockMvcConfigurer configurer : this.configurers) {
        RequestPostProcessor processor = configurer.beforeMockMvcCreated(this, wac);
        if (processor != null) {
            if (this.defaultRequestBuilder == null) {
                this.defaultRequestBuilder = MockMvcRequestBuilders.get("/");
            }
            if (this.defaultRequestBuilder instanceof ConfigurableSmartRequestBuilder) {
                ((ConfigurableSmartRequestBuilder) this.defaultRequestBuilder).with(processor);
            }
        }
    }
    Filter[] filterArray = this.filters.toArray(new Filter[0]);
    
    // 3. 创建MockMvc
    return super.createMockMvc(filterArray, mockServletConfig, wac, this.defaultRequestBuilder,
            this.defaultResponseCharacterEncoding, this.globalResultMatchers, this.globalResultHandlers,
            this.dispatcherServletCustomizers);
}
// 源码位置:org.springframework.test.web.servlet.MockMvcBuilderSupport
protected final MockMvc createMockMvc(Filter[] filters, MockServletConfig servletConfig,
        WebApplicationContext webAppContext, @Nullable RequestBuilder defaultRequestBuilder,
        @Nullable Charset defaultResponseCharacterEncoding,
        List<ResultMatcher> globalResultMatchers, List<ResultHandler> globalResultHandlers,
        @Nullable List<DispatcherServletCustomizer> dispatcherServletCustomizers) {

    // 4. 创建MockMvc
    MockMvc mockMvc = createMockMvc(filters, servletConfig, webAppContext, defaultRequestBuilder, globalResultMatchers, globalResultHandlers, dispatcherServletCustomizers);
    mockMvc.setDefaultResponseCharacterEncoding(defaultResponseCharacterEncoding);
    return mockMvc;
}
// 源码位置:org.springframework.test.web.servlet.MockMvcBuilderSupport
protected final MockMvc createMockMvc(Filter[] filters, MockServletConfig servletConfig,
        WebApplicationContext webAppContext, @Nullable RequestBuilder defaultRequestBuilder,
        List<ResultMatcher> globalResultMatchers, List<ResultHandler> globalResultHandlers,
        @Nullable List<DispatcherServletCustomizer> dispatcherServletCustomizers) {
    // 5. 创建一个mock的TestDispatcherServlet,其继承于DispatcherServlet
    TestDispatcherServlet dispatcherServlet = new TestDispatcherServlet(webAppContext);
    if (dispatcherServletCustomizers != null) {
        for (DispatcherServletCustomizer customizers : dispatcherServletCustomizers) {
            customizers.customize(dispatcherServlet);
        }
    }
    try {
        dispatcherServlet.init(servletConfig);
    }
    catch (ServletException ex) {
        // should never happen..
        throw new MockMvcBuildException("Failed to initialize TestDispatcherServlet", ex);
    }

    // 6. TestDispatcherServlet对象存储到MockMvc对象中
    MockMvc mockMvc = new MockMvc(dispatcherServlet, filters);
    mockMvc.setDefaultRequest(defaultRequestBuilder);
    mockMvc.setGlobalResultMatchers(globalResultMatchers);
    mockMvc.setGlobalResultHandlers(globalResultHandlers);

    return mockMvc;
}


// 7. 调用mockMvc.perform()的时候
// 源码位置:org.springframework.test.web.servlet.MockMvc
public ResultActions perform(RequestBuilder requestBuilder) throws Exception {
    if (this.defaultRequestBuilder != null && requestBuilder instanceof Mergeable) {
        requestBuilder = (RequestBuilder) ((Mergeable) requestBuilder).merge(this.defaultRequestBuilder);
    }

    // 8. mock个请求Request
    MockHttpServletRequest request = requestBuilder.buildRequest(this.servletContext);

    AsyncContext asyncContext = request.getAsyncContext();
    // 9. mock个响应Response
    MockHttpServletResponse mockResponse;
    HttpServletResponse servletResponse;
    if (asyncContext != null) {
        servletResponse = (HttpServletResponse) asyncContext.getResponse();
        mockResponse = unwrapResponseIfNecessary(servletResponse);
    }
    else {
        mockResponse = new MockHttpServletResponse();
        servletResponse = mockResponse;
    }

    if (this.defaultResponseCharacterEncoding != null) {
        mockResponse.setDefaultCharacterEncoding(this.defaultResponseCharacterEncoding.name());
    }

    if (requestBuilder instanceof SmartRequestBuilder) {
        request = ((SmartRequestBuilder) requestBuilder).postProcessRequest(request);
    }

    MvcResult mvcResult = new DefaultMvcResult(request, mockResponse);
    request.setAttribute(MVC_RESULT_ATTRIBUTE, mvcResult);

    RequestAttributes previousAttributes = RequestContextHolder.getRequestAttributes();
    RequestContextHolder.setRequestAttributes(new ServletRequestAttributes(request, servletResponse));

    // 10. 创建个MockFilterChain(实现javax.servlet.FilterChain接口),把TestDispatcherServlet对象放进去
    MockFilterChain filterChain = new MockFilterChain(this.servlet, this.filters);
    // 11. 执行FilterChain的doFilter()接口,MockFilterChain的内部类ServletFilterProxy也是个filter,遍历filter会调到ServletFilterProxy这个filter
    filterChain.doFilter(request, servletResponse);

    if (DispatcherType.ASYNC.equals(request.getDispatcherType()) &&
            asyncContext != null && !request.isAsyncStarted()) {
        asyncContext.complete();
    }

    applyDefaultResultActions(mvcResult);
    RequestContextHolder.setRequestAttributes(previousAttributes);

    return new ResultActions() {
        @Override
        public ResultActions andExpect(ResultMatcher matcher) throws Exception {
            matcher.match(mvcResult);
            return this;
        }
        @Override
        public ResultActions andDo(ResultHandler handler) throws Exception {
            handler.handle(mvcResult);
            return this;
        }
        @Override
        public MvcResult andReturn() {
            return mvcResult;
        }
    };
}

// 12. MockFilterChain的内部类ServletFilterProxy也是个filter,执行MockFilterChain里的filter时会调到
// 源码位置:org.springframework.mock.web.MockFilterChain.ServletFilterProxy
private static final class ServletFilterProxy implements Filter {
    public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException {
        // 13. delegateServlet就是TestDispatcherServlet,执行其service()方法
        this.delegateServlet.service(request, response);
    }
}

// 源码位置:org.springframework.test.web.servlet.TestDispatcherServlet
protected void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
    registerAsyncResultInterceptors(request);
    // 14. 其父类为DispatcherServlet(org.springframework.web.servlet.DispatcherServlet),调用DispatcherServlet的service()方法
    super.service(request, response);

    if (request.getAsyncContext() != null) {
        MockAsyncContext asyncContext;
        if (request.getAsyncContext() instanceof MockAsyncContext) {
            asyncContext = (MockAsyncContext) request.getAsyncContext();
        }
        else {
            MockHttpServletRequest mockRequest = WebUtils.getNativeRequest(request, MockHttpServletRequest.class);
            Assert.notNull(mockRequest, "Expected MockHttpServletRequest");
            asyncContext = (MockAsyncContext) mockRequest.getAsyncContext();
            String requestClassName = request.getClass().getName();
            Assert.notNull(asyncContext, () ->
                    "Outer request wrapper " + requestClassName + " has an AsyncContext," +
                            "but it is not a MockAsyncContext, while the nested " +
                            mockRequest.getClass().getName() + " does not have an AsyncContext at all.");
        }

        CountDownLatch dispatchLatch = new CountDownLatch(1);
        asyncContext.addDispatchHandler(dispatchLatch::countDown);
        getMvcResult(request).setAsyncDispatchLatch(dispatchLatch);
    }
}

可见,在测试的过程中,省掉了tomcat server的过程,而直接调DispatcherServlet的service()方法来模仿http请求的响应。整个过程需要依赖springboot的执行,所以需要有@SpringBootTest注解,里面指定了springboot的基础执行,同时要提供一个MockMvc对象来总控该流程,所以需要@AutoConfigureMockMvc注解才能自动创建MockMvc对象。

3 架构一小步

1、使用@SpringBootTest、@AutoConfigureMockMvc注解来进行http请求集成测试。

2、http请求集成测试可以注入MockMvc对象,调用该对象的perform()接口来模仿http请求响应。

AI工程师实战地图:Foundation Models落地七道生死关 大语言模型(LLM)已从研究热点进入工程化深水区,Foundation Models作为能力基座,其价值不在于参数规模,而在于如何与真实业务系统耦合。理解预训练、微调、推理优化等环节的技术原理,是构建稳定AI服务的前提;而Emergent Abilities的可控调用与Evaluation Rigor的体系化建设,则决定了模型能否跨越‘能跑’到‘可信’的关键鸿沟。本文聚焦金融、医疗、制造等典型行业场景,拆解从模型选型、LoRA配置、vLLM部署到RAG评估的全链路实操陷阱,尤其强调工程负债、数据漂移、延迟毛 阅读详情

相关推荐

MLOps实战:从模型跑通到产线落地的完整工程链路

机器学习模型部署不是终点,而是工程化交付的起点。MLOps 本质是将数据治理、模型开发、持续集成与线上监控等环节系统整合,解决数据漂移、环境不一致、概念漂移等80%真实故障根源。其核心在于构建可复现、可监控、可回滚的端到端流水线,支撑模型在边缘设备(如Jetson)、高并发场景及动态业务环境中稳定运行。本文以手机屏幕划痕检测产线为案例,详解Scoping需求量化、Data契约管理、Modeling实验追踪与Deployment渐进发布四大阶段,覆盖MLOps全生命周期关键实践。

weixin_34331102的博客 399

SpringBoot配置enableLoggingRequestDetails为true

SpringBoot版本: 2.2.6.RELEASE 启动SpringBoot项目,enableLoggingRequestDetails默认值为false,控制台会打印如下: enableLoggingRequestDetails='false': request parameters and headers will be masked to prevent unsafe logging of potentially sensitive data 如何配置enableLoggingRequestDe

DANGTE的博客 7370

UCP协议驱动的AI购物代理:构建可控、可溯、可验的商业级AI Agent

AI购物代理是面向电商场景的智能决策系统,其核心挑战在于动作可控性、状态可追溯性与结果可验证性。传统Chain-of-Thought架构易导致意图漂移、状态丢失和结果幻觉,而UCP(Universal Control Protocol)通过语义抽象、契约约束、执行状态机与结构化审计四层设计,将非确定性大模型行为纳入工业级控制流。该协议强调动作前置校验、置信度量化、动态降级与全链路溯源,显著提升数据新鲜度、跨平台一致性与业务可解释性。适用于需对接京东、淘宝、拼多多等多源实时API的比价导购、自动选品与可信推荐

weixin_30443731的博客 432

基于springboot架构项目的白盒审计经验分享

Spring是Java企业版的轻量级代替品,通过依赖注入和面向切面编程,用简单的Java对象实现了EJB的功能。但是Spring用到了很多xml配置,这种重量级配置也是spring的一个重大缺点。springboot是一个构建在Spring框架顶部的项目。在springboot框架中已经嵌入了tomcat,jetty,Undertow等web容器,因此在使用springboot开发时不需要部署WAR文件,只需要通过自己的启动器(Starter)来,简化项目的构建配置。

韩束一叶子 1676

Cursor深度使用指南:从AI补全到智能重构的工程化实践

AI编程工具已从简单代码补全迈入上下文感知与工作流嵌入的新阶段。理解其底层原理——如项目级上下文建模、多粒度交互设计(内联编辑/Composer/Agent)、以及模型对中文工程术语的理解差异——是提升开发效能的关键。Cursor并非VS Code换皮,而是将AI深度集成进真实软件交付流程:通过自动加载Git状态与文件依赖构建语义上下文,以Ctrl+K实现秒级战术修改,用Composer完成跨文件受控重构,并借Agent模拟工程师级任务拆解与执行。尤其对中文开发者,Claude 3.5 Sonnet在接口定

weixin_33860528的博客 402

Java 后端 & AI 应用面试题精讲(含流程图解说)

本文系统梳理了JVM、Redis、MySQL、Spring Boot、Kafka、微服务、Linux及AI后端等核心面试知识点,涵盖内存管理、垃圾回收、数据结构、缓存策略、高可用架构等关键技术。重点解析了JVM内存模型与GC机制、Redis高性能原理与持久化方案、缓存三大问题应对策略,以及分布式场景下的实战设计思路,适用于中高级研发岗位技术面试准备。

weixin_40875550的博客 342

软件测试面试与实战全攻略:从理论到技术深度解析

软件测试是确保软件质量的关键环节,涉及从需求分析到产品发布的整个生命周期。其核心原理包括黑盒与白盒测试方法,通过自动化工具如Selenium、JMeter等实现高效验证。在工程实践中,测试不仅保障功能正确性,还能通过性能测试、安全测试等技术手段提升系统可靠性。特别是在面试场景中,测试工程师需要展示对LoadRunner等工具的应用能力,以及处理争议性Bug的解决思路。随着DevOps和持续测试的普及,测试左移与右移策略成为行业热点,帮助团队在敏捷开发中快速交付高质量产品。

weixin_33805992的博客 366

【信息科学与工程学】【通信工程】第八十六篇 通信网络设备及通信网络组网的所有学科知识01

编号001类型网络虚拟化与覆盖技术网络领域数据中心网络子领域大二层网络 / 网络虚拟化核心数学方程式/算法模型核心算法:VXLAN封装与解封装。关键在于24位VNI(虚拟网络标识符)到物理网络的三层IP地址的映射。封装:收到原始以太帧后,为其添加 VXLAN 头部(含 VNI)、外层 UDP 头(目的端口 4789)、外层 IP 头(源 IP 为本地 VTEP IP,目的 IP 为对端 VTEP IP)以及外层 MAC 头。解封装:对端 收到报文后,剥离外层头部,根据内层帧的目的 MAC 和 VNI 进行二

weixin_49199313的博客 898

工作中使用到的单词(软件开发)

1.エイリアス   alias 别名 powershell使用 get-help 命令时,会得到与此命令 相关(别名)的命令 2.プロキシ proxy 代 理 3.プロモート   promote 促进,提升   开发的系统新功能上线发布,有时会使用到这个词,比如 STプロモート 还有使用リリース这个词的。比如STリリース。个人认为两者含义相同。 4.見逃し み................................................................

sun0322 6万+

【信息科学与工程学】【数据中心】第三十五篇 云计算数据中心的学科知识04

编号学科(课程)核心知识点在云计算/云存储/云网络/云安全/云MaaS中的作用代表教材/资料/论文 + 数学方程式列表工业界应用D1421​云原生数据库:TiDB​HTAP(混合事务/分析处理)、分布式SQL、水平扩展、强一致(Raft)、自动故障恢复、与MySQL兼容、TiFlash列式引擎提供弹性扩展的分布式数据库;支撑高并发在线交易与实时分析教材:《TiDB in Action》PingCAP(2020) 论文:《TiDB: A Raft-based HTAP Database》(2017)

weixin_49199313的博客 753

病理WSI配准库valis教程

病理WSI配准库valis教程

azrealq的博客 2610

模型上线后如何保障生产稳定性与可治理性

机器学习模型部署不是算法任务的终点,而是系统工程挑战的起点。其核心在于模型服务在真实业务链路中的可靠性、可观测性与合规性——这涉及特征供给契约、多级fallback机制、延迟归因分析、四层监控体系及模型护照治理等关键能力。尤其在金融、医疗、电商等强依赖实时决策的领域,数据漂移、依赖故障、协议错配、时钟偏移等非AI层问题,往往比模型本身更易引发P1级事故。本文聚焦MLOps落地中最易被忽视的‘生产就绪’骨架,覆盖从特征时效性保障、混沌测试设计到审计级日志留痕的全链路实践,为构建高可用、可解释、可担责的AI生产

weixin_30378623的博客 434

半导体AMHS系统振动控制技术演进:从0.5G到超低振动的工艺革命

在半导体制造进入埃米级时代后,AMHS的振动控制能力将成为区分厂商技术等级的标尺。国内企业通过“弹性机械设计-混合主动控制-智能调度”的三重创新,正逐步突破0.2G阈值,支撑12英寸晶圆厂向3nm/2nm制程升级。未来,振动抑制不再仅是物流系统的性能参数,而是与光刻、刻蚀等核心工艺深度耦合的基础能力,这将重塑半导体设备产业的竞争格局。

m0_60674045的博客 1596

IACS UR E27系统取证证据链设计:海事网关、应用软件与集成测试分工

本文从系统工程角度分析。建议整理最终产品名称、主要功能、部署环境、组成设备、外部接口和软件版本,再通过架构图说明各组件之间的关系。例如,网络设备和应用主机完成连接后,需要验证业务通信是否符合设计,相关访问控制是否正常执行,以及应用能否通过授权路径获取所需数据。其次是身份与权限管理。此时,应用负责采集结果展示、报警处理及相关业务操作,网络设备负责连接和边界控制,最终系统供应商负责统筹两者的配套配置。对于采用已有型式认可产品的系统,这种方式有助于整理组件层面的技术依据,并为完整系统的进一步验证提供清晰的参考。

Robustel的博客 493

CANoe基础讲解01:从零开始使用CANoe轻松搭建你的第一个CAN网络

本文是一篇CANoe软件入门实操指南,逐步演示了如何从零创建并运行一个CAN FD仿真工程。内容包括:启动软件、配置硬件通道与网络、加载DBC数据库、使用CAPL编写仿真节点发送CAN报文,最终启动测量并在Trace窗口中查看通信结果。通过七个清晰步骤,帮助初学者快速掌握CANoe基本操作,完成首个可运行的仿真网络搭建

车载网络小D的博客 1585

uniapp 基于单选框多选框实现上拉触底多选/单选、回显

showPickerCheckbox弹层显示 label和value 类似下拉框的label和value一个意思 键和值。结果:可以传接口(接口只能post请求) 可以搜索 下面是结果图片展示 单选多选都可以。fieldValue回显传的值 传的是字符串 数组的话[1,2]转为1,2格式传入。mode是控制的单选还是多选 true为多选默认值 其余参数 单选多选一样。fieldName字段名 确定后会返回该字段名 根据字段名找对应的传入值。问题:在uniapp上 实现分页多选的操作。下面是组件的完整代码。

2301_76607997的博客 2942

MCP 面试高频考点:为服务编写可重复执行的集成测试,如何把 OAuth 2.1 与提示注入防护一起测进去

面试场景 某团队要把一个内部 MCP 服务接入多家客户端,服务端暴露若干工具,其中一部分会读取内部知识库并把内容回灌给模型。上线前负责人提出一个要求:集成测试必须“可重复执行”,既不能每次手工点授权,也不能只测 happy path。面试官。

a3258264204的博客 148

PX4飞控与MAVROS实战:从零搭建无人机ROS通信环境(附常见报错解决)

本文详细介绍了如何从零搭建PX4飞控与ROS的通信环境,重点解析了MAVROS的安装、硬件连接、串口权限配置以及坐标系转换等核心步骤。针对GeographicLib数据下载失败、串口权限不足等常见报错提供了实用解决方案,并附有Offboard模式控制的代码示例,帮助开发者快速建立稳定的无人机ROS开发环境。

dapp9builder的博客 340

企业数字化实战Day4:从角色权限管理到系统集成测试与流程治理

实践平台:飞书多维表格贯穿项目:企业需求与项目管理系统实践方向:企业数字化办公与 AI 应用 / FDE实践版本:权限方案 V1.0;AUTO-004 工作流 V2.0 配图说明:均为本人提供的本阶段真实实操截图;部分截图已裁切或遮挡个人信息及具体操作时间,未对业务结果作修改。

lmyh1111的博客 282

基于STM32设计的老人摔倒检测报警系统【升级版】(235)

在 `235 基于STM32设计的老人摔倒检测报警系统(OneNet+MQTT)` 项目基础上增加了心率、血氧、体温测量3个功能。

1515

基于DO-178C/331的飞控软件研发环境的研究

本研究提出了一套基于DO-178C/331标准的飞控系统软件开发和验证框架。通过优化模型库的设计、代码生成配置和测试验证流程,显著提升了飞控系统软件的开发效率和安全性。未来的研究可以进一步扩展模型库的功能,以适应更复杂的飞控系统需求。

qq_41854911的博客 565

SAP CO 初级(一)——学 CO 之前要补的三块基础:管理会计、FI 与后勤(附 ACDOCA 实操)

SAP CO 技能树系列第 1 篇:用算例讲清固定与变动成本、价差与量差、边际贡献;梳理 FI 的字段状态、凭证拆分,MM 的标准价与移动平均价、OBYC,PP 的数量结构与工单成本流,SD 的收入确定;动手过 5 张凭证,逐字段看 ACDOCA 里 FI 和 CO 怎样落在同一行。附排错表与自测题,S/4HANA 2022 核对。

缘起缘灭皆为因果,看到就是缘分,点赞收藏一键三连吧! 298

蓝牙模块HM-10手册

蓝牙模块HM-10手册,该手册对蓝牙模块HM-10进行了详细的介绍和使用方法以及一些AT指令。

《阿里巴巴 Java 开发手册》的 MySQL 核心规范

既然你平时经常自己练习表结构设计,那这份提炼自《阿里巴巴 Java 开发手册》的 MySQL 核心规范,绝对是你日常建表和写 SQL 时的“避坑宝典”。我帮你把最核心的【强制】级别规范,按和。

qq_26889291的博客 385

jre9下载 jdk9

(Java SE Runtime Environment 9.0) 9.0u175 官方最新版 【x86|x64】

TMS_WebGMaps_1.9.8.0_Full_Source

TMS_WebGMaps_1.9.8.0_Full_Source 全源码 delphi cbuilder

Java IO流核心分类与应用

Java IO 流体系庞大,主要依据和三个维度进行分类。正确选择流类型是避免乱码和提升性能的前提。

2601_96005375的博客 310

迈瑞BS系列全自动生化分析仪LIS协议接口手册(内含HL7和ASTM)

迈瑞BS系列全自动生化分析仪LIS协议接口手册,内含HL7和ASTM)

Java方向-AI核心技能栈

software_0215的专栏 162
上一篇: 小架构step系列13:测试用例的加载
下一篇: 小架构step系列15:白盒集成测试
秋千码途
博客等级 码龄21年 190粉丝 41原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值